Hello all,
Following the project - person exemple I did the following thing :
execute the two sample code below, the first didn't worked (i.e OJB
didn't update the project's list but the second did. Don't understand
why, because in the tutorial, it is said that all update should be done
between transaction like the first case.
Anyone can help?
1) *******************************************************************
String queryString = "select project from " + Project.class.getName() +
" where id=1";
query.create(queryString);
DList list = query.execute();
Project project1 = (Project) list.get(0);
Person john = new Person();
john.setId(new Integer(3));
john.setFirstname("Francois");
john.setLastname("Gombault");
tx = odmg.newTransaction();
tx.begin();
tx.lock(cm, Transaction.WRITE);
project1.addPerson(john, "project1");
tx.commit();
************************************************************************
2) ********************************************************************
String queryString = "select project from " + Project.class.getName() +
" where id=1";
query.create(queryString);
DList list = query.execute();
Project project1 = (Project) list.get(0);
Person john = new Person();
john.setId(new Integer(3));
john.setFirstname("Francois");
john.setLastname("Gombault");
project1.addPerson(john, "project1");
tx = odmg.newTransaction();
tx.begin();
tx.lock(cm, Transaction.WRITE);
tx.commit();
**************************************************************************
--
Kevin Viet <[EMAIL PROTECTED]>
ActiVia Networks
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>