Hello all

ODMG specify that an object must be updated in between transaction
bounds

try {
  tx.begin()
  obj.setA(a);
  obj.setB(b);
  // ...
  tx.commit()
}
catch (Throwable t) {
  tx.rollback();
}

First question : if an error occurs after obj.setB() will the object
remains in an unaffected state ?

Second question : 
I can't manage to design a generic method to update my object with ODMG,
in effect with the persistence API, the only things to do is to call
update(object) on the broker API and the broker update the database.
With ODMG I have to create methods for all model objects and to put all
properties as arguments to these method in order to do in my method :

public void updateObjectOfClassA(A a, String prop1, String prop2,
String  prop3, .... )
{ 
  .....
  tx.begin()
  a.setProp1(prop1);
  a.setProp2(prop2); 
  .... 
  a.setPropN()
}

A hint or a source code could be of valuable help

-- 
Kevin Viet <[EMAIL PROTECTED]>
ActiVia Networks




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to