Re: Database resultset managing best practices
Gregg Wonderly <[email protected]>
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <[email protected]> |
RowSets would be one way to do this. Another pattern that also works, but does
not use Javaspaces is a Smart Proxy. If you have an interface such as
public interface MyDataAccess {
public List<Customer> getCustomers() throws IOException, SQLException;
public List<Jobs> getJobs(
Customer cust ) throws IOException, SQLException;
public JobInfo getJobInfo(
Job job ) throws IOException, SQLException;
}
A smart proxy implementation would be sent from the server to the client with
the appropriate JDBC configuration. The smart proxy would just be a
serializable object that carried the JDBC information with it. It would then
execute the JDBC operations from the client. Thus, the client would not need to
know about the JDBC connectivity parameters, it would just need to know how to
use the public API.
Storing large objects into Javaspaces as a temporary exchange of data interface,
is possible, but unless you have lots of queries and lots of work for each query
where you want to distribute the load, the use of Javaspaces might not be a good
match.
Gregg Wonderly
Tom Cellucci wrote:
> I haven't used them personally, but I think that rowsets (
> http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/package-summary.html)
>
> would be a good fit for what you're describing. The implementations of
> RowSet are serializable and are intended to be passed between components.
>
> Tom
>
> On 5/9/06, Andrea Angeloni <[email protected]> wrote:
>
>>
>> I'm using JavaSpaces as a middle layer between clients and servers of a
>> database. My idea was to pass a query to servers and returns resultsets
>> from
>> these using an entry.
>>
>> The problem: ResultSet is not serializable.
>>
>> I could simply use serializable objects derived from server-side
>> resultset
>> processing, but I have no idea how to use this technique in an absolute
>> general manner (I want to pass absolutely general queries, so I have
>> absolutely general results to pass from the client).
>>
>> Can you indicate me any "best practices" on solving this problem in the
>> JavaSpaces world? I think it's a very often ecountered problem.
>> Thanks, Andrea
>>
>>
>> ===========================================================================
>>
>> To unsubscribe, send email to [email protected] and include in the
>> body
>> of the message "signoff JAVASPACES-USERS". For general help, send email
>> to
>> [email protected] and include in the body of the message "help".
>>
>> To view past JAVASPACES-USERS postings, please see:
>> http://archives.java.sun.com/archives/javaspaces-users.html
>>
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html