I am not sure what this can do for me. I'v been trying to build a system with wich people can work on local servers. Those local servers synq themselves with the main server. When the main server is down the local servers can keep doing their work. When the main server is up again the local servers will have to get in synq again. As i said i'v been trying to do this but failed. Can db4objects be helpfull in this scenario?Dennis, we're building a similar system with the plain Hibernate3 session.replicate() feature. We're quite early with development but our initial proof of concept tests are pretty successful. Can you briefly sum up what pitfalls you encountered? I think it'd be useful to know about your experiences. Also, (from the db4o guys), a brief feature comparison of db4o and hibernate's built-in replication features would come handy with our current mission (we'd happily consider getting commercial support if applying db4o is a worthy and rewarding decision.
My approach was a transfer table in wich every update was stored. The transfer table records had a tablename field , a recordid field and an operation type field. An operation can be an add to a collection or a detachment of a reference and some more types.
Straight after the insert in the transfer table the record was send transient to the server whereafter the server can perform the update operation on the appropriate object.
My problem was the id thing. If the servers have to communicate asynq there is no way that the local server can issue valid id's without complex administration by means of number sequences or something like that.
The updates from one local server to the main server have to be further distributed to all local clients to have the system as a whole in synq.
In case of insert the local server that initially did send the insert to the main server will get back his own insert with another id because only the main server can issue valid id's, all references to the old id have to be updated in the local system whereafter the original local insert can be deleted.
If the main server is down the local system just keeps writing everything to the transfer table. A thread checks every now and then if the main server is up again and if it is up it sends all records in the transfer table to main server.
It kind of works but the transaction handling is really complicated and I dont know how it will behave in serious applications. It is also a time consuming feature to implement, it takes a lot of time wich i hardly have on my current project.
What exactly does the hibernate session.replicate() method do. How do you use it. What if the connection is lost?