Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.0
Mapping documents:General Question
While investigating how we would introduce hibernate persistence in our 3 tier application we are faced with a possible issue/dilemma.
System is thick client and application server/servlet. Swing on the client and business logic processing and persistance will be on server. This is a current running system with legacy persistance.
Our persistant business objects are well defined. They are distributed. That is to say our business object is delivered to the client via SOAP/XML and the objects are reconstituted into java and the client works with them
Scenario
The question is this using a simple single class business object, called Employee (for example).
Server: An instance of Employee is gotten from the DB, assume it has an ID of 100.
Client receives an instance of Employee through SOAP/XML. Client then changes the wages.
Server receives updated instance of Employee from client. ID 100, with new wages.
Now, the question is this. How do we get the changes to the database.
What we would like to do is ask the persistence layer to accept the changed object that we received from the client and update the database. Can this new instance that was provided to the server with just the changes be considered a detached object? It is not technically the exact same objects that were in the session when the session was closed. Can a new session be opened and can this instance of Employee be attached/synchronized to the new session and updated?
Or, are we faced with some way coding our own synchronization between the copy of the object sent to the client for update and the copy we started with on the server? I hope not, since we would be forced to do essentially what we were hoping to use the ORM for.