The RDB DAS currently has a simple paging capability that is implemented by wrapping a Command. Here is a simple example:

       // Build command to read all customers
Command readCustomers = das.createCommand("select * from CUSTOMER order by ID");

       // Create a pager with page size 15
       Pager pager = new PagerImpl(custCommand, 15);

       // Get and work with first page
       DataObject root = pager.next();

       // Get and work with the second page
       root = pager.next();

       // First page again
       root = pager.previous();


This works well if the client of the page data is on the server but not so well if the client is not. The reason is that the pager wraps a command instance which, in turn, references a connection. For a pager to work in a "disconnected" mode it should probably be serializable and very lightweight (it might be stored in session for instance) and it cannot count on the original connection to be available. I think this could easily be achieved by removing the instance variable from the pager that references it's command. Instead, the command can be passed as an argument to the paging methods like this:

     DataObject root = pager.next(someReadCommand);

Does this sound reasonable?

--
Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to