Hi Roland,

Are you using an O/R mapper like Hibernate or JDO to do your persistence or pure JDBC code?

You could embed one of the OSS DB's like Apache Derby or HSQL?

Your app could then start up with different SessionFactory configurations depending offline or online mode...
Minimal code changes would be my guess...

My initial thoughts would be that every record in every table would have to have a sync flag of sorts ( to indicate it has been synced with the master database ).

You could then use Hibernate Event Handlers to set the sync flag to offline on all persisted objects without having to impact to greatly on your existing code.

When your application is then switched to online mode, just do a quick run through all tables in the local DB where the objects have an offline flag and persist those to your master online DB? And reset the flag in your local DB? Could also include revision numbers if you wanna get really funky...

That way you could then give the user the ability to resolve conflicts between his offline data which he may have changed and online data that someone else may have changed there?

Hope it helps...

Cheers,
Renier

Roland Giesler wrote:

I looking for some advice regarding using a disconnected java application
running on Postgres.
Scenario: A Java web application read/writes a PG database in a
transactional environment.  To be more specific, status information about
clients is looked up from some table(s), and a number of lines are then
entered into an order.  The items that can be ordered are in another table,
which must also be available offline.  Lastly the completed order must of
course also be available offline, for submission later when an internet
connection is available again.
Now this application should be able to work when disconnected from the
server.  Of course the application can be written to create offline copies
of the data in a local file, but basically that would cause some problems,
since it would involve a lot of coding firstly, but also mean that different
code would be required for online and offline operation.

My question is, is there any technology that would allow this type of
funtionality with Postgres, like some type of caching enjine, or something
else, acting as a sort of mini "middleware" of sorts (to borrow that term)
to do this for me.

Thanks

Roland Giesler





Paltrack Pty (Ltd) Reg No 2000/002936/07
Directors: P.W. Mountford (Chairman) | A.J. Mouton (Managing) | S.I. Rocher | 
A.J. de Haast | J.G.F. du Plessis

This email and any accompanying attachments may contain confidential and 
proprietary information. This information is private
and protected by law and, accordingly, if you are not the intended recipient, 
you are requested to delete this entire
communication immediately and are notified that any disclosure, copying or 
distribution of or taking any action based on this
information is prohibited.

Emails cannot be guaranteed to be secure or free of errors or viruses. The 
sender does not accept any liability or
responsibility for any interception, corruption, destruction, loss, late 
arrival or incompleteness of or tampering or
interference with any of the information contained in this email or for its incorrect delivery or non-delivery for whatsoever reason or for its effect on any electronic device of the recipient.

If verification of this email or any attachment is required, please request a 
hard copy version.
______________________________________
Queries to: [EMAIL PROTECTED]

Reply via email to