cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Murphy <>
Subject How well can the client and server can be made to work together?
Date Wed, 23 Jan 2008 12:35:54 GMT

I haven't used Cayenne but would like to think thru how it could be 
used. Specifically Cayenne Remote Object Persistence seems like a great 
way of implementing an exposed domain model with a Swing GUI client. 
However most Swing applications of any complexity also need to access 
server side methods. My question goes to how well the client and server 
can be made to work together.

In JDO the Entity Manager (that's JPA (EJB3.0) terminology) is called a 
Persistent Manager (PM), in Hibernate a Session. In JDO a remote PM 
exists on the client and talks to its partner PM on the server. From the 
Cayenne documentation it looks as if I can say that a CayenneContext on 
the client seemlessly makes requests on its DataContext that resides on 
the server.

If you are using Spring lightweight remoting for services then to make 
queries faster your Spring service methods will want access to the same 
DataContext that the CayenneContext is accessing. In fact it would be 
great if they could even access the same 'cursor' of query result 
objects. Thus if your application had just done a query on the client 
and then called a Spring service method, and as part of its working the 
method needed to use the same result set (which is an object graph) that 
the client had just requested - then the server side method should be 
able to access it. In fact if the client or the server modifies and 
commits result set data, then the other side (server or client) ought to 
be able to access that data without re-querying. Is this Spring/Cayenne 
integration possible with Cayenne?

Note there are two stages to the question. For the DataContext to be 
shared it would make sense for the Spring and Cayenne Web services to be 
running on the server in the same JVM. Getting to this stage would be 
pretty good as the DataContext's cache of 'all objects that it has 
recently queried' would be shared. Getting to the next stage, of having 
shared -updatable data object result sets- would be great as it would 
mean that queries would not even need to be repeated.

With Cayenne can you get to stage one or stage two?

thanks - Chris Murphy (


View raw message