March 25, 2008

Flex 3.0 + Spring JDBC + BlazeDS = awesome

Follow-up to Using BlazeDS to invoke server side Java classes from client side Flex Flash applications from Transversality - Robert O'Toole

And for my next trick: accessing the last row in a 10,000 row SQL Server database table, in an instant, from within a Flex 3.0 application via BlazeDS and the Spring JDBC abstraction mechanism. I am quite amazed.

I am investigating the possibility of moving the query layer of a web application off the SQL Server that hosts the data (so as to allow me to more easily move the database to another platform). Last week I mastered BlazeDS for Java remoting. That was easy. So I decided to add Spring to the mix, following this excellent article from Adobe Labs. I’ve never used Spring before, but understand how it simplifies such applications.

It didn’t take long to understand the example from Adobe, and adapt it to query the SQLServer database that I have used.

And when I pressed the ‘query’ button on my Flex app, I was astonished. 10,000 rows appeared immediately as an ArrayCollection. Whereas my Flex/JSON/Java app would request 100 rows at a time, with a new query each time the datagrid page was changed, I can now load every single record and immediately work with it in the browser.

Next trick? Hibernate.

- 4 comments by 2 or more people Not publicly viewable

  1. Steven Carpenter

    Cool, and thanks for the guide. Have you run your code through the Flex 3 profiler? It’d be interesting to see the performance.

    25 Mar 2008, 20:44

  2. Robert O'Toole

    As one would expect, memory use is doubled by doing the query. However, if I redo the query, it doubles again for a while, before dropping back.

    The real performance test will be when I start to filter those big record sets in a datagrid control. For example, one of the queries returns a table of publications. They might be books, journals, movies etc. Currently, the user has to specify the type of publications required as part of the query. However, with BlazeDS it should be easy to allow them to retrieve all of the records, and then filter them using an interface on the same page as the datagrid. So they would, for example, view the results, then uncheck the ‘movies’ box so that they no longer see movies in the list.

    I’m expecting that to work really smoothely.

    26 Mar 2008, 09:42

  3. Robert O'Toole

    In fact, I don’t need a separate query UI. I’ll just find some really neat way of putting the query fields on the same page as the datagrid. It will be more like a set of filters than a query. I reckon that will be more intuitive.

    26 Mar 2008, 10:02

  4. Comment awaiting approval

    This comment is awaiting approval by the author of the entry.

    31 May 2008, 23:13


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.