Sync two databases

253 views
Skip to first unread message

MicheleDG

unread,
Jul 8, 2008, 6:18:10 PM7/8/08
to H2 Database
Hi !
I'm trying to get in sync two copies of a H2 database in a scenario
where I have a simple java app using an embedded database and a H2
server running somewhere else.
My app needs to access data locally even when not connected to
internet and when a connection is available it should get from server
new/updated records without writing any data on the server itself (no
data entry on the app).
On Sun's JDBC forum somebody suggested me to keep working "offline",
copying updated db files manually to avoid any problem, but someother
told me I could use db syncronization feature (bypassing jdbc which
seems a difficult task to my knowledge).
So my question is : how to do that in H2 ?
Maybe a simple query is sufficient but I'm messing around with
documentation without found a solution.
Any help ? Thanks a lot !

Michele

Thotheolh

unread,
Jul 8, 2008, 8:36:51 PM7/8/08
to H2 Database
This sounds more like you need to create or find some database sync
utility. I don't see any utility or methods in H2 capable of such
things for now.

Thomas Mueller

unread,
Jul 12, 2008, 12:30:46 PM7/12/08
to h2-da...@googlegroups.com
Hi,

> This sounds more like you need to create or find some database sync
> utility. I don't see any utility or methods in H2 capable of such
> things for now.

That's true. H2 does not provide a good database synchronization
utility. Of course you can always copy the complete database (using
SCRIPT / RUNSCRIPT), but that's probably not what you want.

Regards,
Thomas

MicheleDG

unread,
Jul 13, 2008, 4:39:08 PM7/13/08
to H2 Database
Hi,
I wasn't aware of the Script/Runscript feature of H2 which maybe
better than synchronization in my case.
I just need to understand the syntax to restore from a remote db...but
the documentation should be enough ;-)
I'm going to try it soon and then let you know how it works.
Thanks a lot for the tips !
Best regards

Michele
Reply all
Reply to author
Forward
0 new messages