openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egoosen <egoos...@metropolitan.co.za>
Subject Re: Non dirty entity version field update SUPER URGENT!!!
Date Tue, 30 Sep 2008 16:01:36 GMT

Hi Michael,

Its a long story, but you can read about it here:
http://n2.nabble.com/%40OneToMany-%40ManyToOne%2C-Bidirectional%2C-Composite-Key-BUG-tc210672.html#a221083
http://n2.nabble.com/%40OneToMany-%40ManyToOne%2C-Bidirectional%2C-Composite-Key-BUG-tc210672.html#a221083


In the mean time, I've simplified my test case like so:
public void updateTblFndmst(TblFndmst tblFndmst){
		try {		 
			oem.getTransaction().begin();
			em.merge(tblFndmst);
			oem.getTransaction().commit();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
...and the version number is still incrementing.

The relavant OpenJPA code appears to be:
StateManagerImpl: line 1572
if (active) {
                if (_broker.getOptimistic()) //<-- here
                    setPCState(_state.beforeOptimisticWrite(this, field,
                        mutate.booleanValue())); 
                else
                    setPCState(_state.beforeWrite(this, field,
                        mutate.booleanValue()));
            }
			
PNonTransState: line 80
PCState beforeOptimisticWrite(StateManagerImpl context, int field,
        boolean mutate) {
        if (context.getBroker().getAutoClear() == AutoClear.CLEAR_ALL)
            return beforeWrite(context, field, mutate, true);
        return PDIRTY; //returns PDIRTY
    }

Will debug some more tomorrow.
-- 
View this message in context: http://n2.nabble.com/Non-dirty-entity-version-field-update-SUPER-URGENT%21%21%21-tp1120307p1129303.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message