cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Alderton-Smith <>
Subject Online/Offline
Date Wed, 05 Aug 2009 21:49:08 GMT
Here's something I just can't figure.  I'm writing a rich client based
on the Netbeans plaftorm that must be able to run in online and offline

I have got Cayenne to run successfully remotely connected to my
glassfish server and everything works great.

What I do is wrap getting the data context so I can control whether to
use the remote one or a local derby based context depending on whether
the client application is in on or offline mode.

The problem I see, is that any references to classes in my code are to
the client classes generated by Cayenne for the server objects, but
would need to be the actual full server classes to work with the derby
database, so I see no way of making all my code generic.

Has anyone come across this idea before, and is there perhaps a way to
use the client classes, but without a remote connection as such.  That
way my code won't care whether it's talking to the server or the local
derby database, except when it comes to the datacontext itself.
otherwise I'll have to integrate the online/offline code throughout the
system, which is going to be a lot of work.

Simple question at the end of the day.... can you use the lighter client
classes locally somehow?

Any help would really be appreciated.  I haven't been working with
Cayenne for long, but it's been good enough for me to give up on
hibernate, jpa and all the other alternatives due to it's remoting

View raw message