Hi, The ODMG layer tracks changes in an object. When you lock an object for write, the internal gubbins of OJB essentially stores a map of the objects attributes. When you commit the ODMG transaction, OJB then checks the values of the locked object against the stored map. If the any of the values have changed, it will perform an update.
In your example, you lock then immediately commit; no changes will have been noted. HTH, Charles. >-----Original Message----- >From: Edson Carlos Ericksson Richter >[mailto:[EMAIL PROTECTED] >Sent: 24 March 2003 23:36 >To: 'OJB Users List' >Subject: Proxy & updates > > >Hi! > >I think I've lost something "in the way she moves...": > >I get a list of objects using OQLQuery. In XML I've used >proxy="dynamic". >Works fine. I show the objects in a JTable. >Fine. All working. Great. Fast, works as many time I test. > >Now, user change a value in a cell (I don't allow user to >change Primary >Key). >Change made by the user is "set" in proxy object (and using a >debugger I see >value changed on realSubject). >All fine to here. Now user presses a "Save changes" button. > >I do (p is my proxied object passed throught a Interface, as defined in >Tutorials and in JDK 1.4.1_02 docs): > >{ > Transaction t = this.odmg.newTransaction(); > > t.begin(); > > t.lock( p, Transaction.WRITE ); > > t.commit(); >} > >When I execute the query again, values has not been changed. Even, in >database was not changed. I need to be inside a transaction to >call "set" >methods? Exists any bugs in OJB RC1 that prevents proxied objects to be >updated? > >db.deletePersistent works fine (with proxied and non proxy >objects), and new >(non proxy) are stored fine too. > >Thanks for any clarification. > >Edson Richter. > > > >--- >Outgoing mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.463 / Virus Database: 262 - Release Date: 17/3/2003 > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
