You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Craig Russell <cr...@oracle.com> on 2016/07/08 16:05:23 UTC

JDO group?

The JDO group seems to have disappeared. I’ll set up the Oracle toll-free conference number now…

Craig L Russell
Architect
craig.russell@oracle.com
P.S. A good JDO? O, Gasp!






Re: JIRA 747

Posted by Andy Jefferson <an...@datanucleus.org>.
Hi Tilmann,

> (sorry for double posting, I sent this to andyj@apache.org before)

I haven't used the Apache email for years since Apache gets loads of spam; I'd guess it goes to /dev/null on my ISP :-)

> I started looking into adapting datanucleus for JDO JIRA 747: 
> https://issues.apache.org/jira/browse/JDO-747
> 
> Some time ago you offered to give some initial pointers, could you tell 
> me where to start?
> 
> My first goal: Update datanuclues so that a PERSISTENT_NEW object 
> transitions to PERSISTENT_CLEAN when they are refreshed _and_ if there 
> is an object with the same ID in the database.

The first place to look is the StateManager, which is in "datanucleus-core" at 
https://github.com/datanucleus/datanucleus-core/blob/master/src/main/java/org/datanucleus/state/StateManagerImpl.java

The transition in Lifecycle states for JDO is controlled from "datanucleus-api-jdo", in this package
https://github.com/datanucleus/datanucleus-api-jdo/tree/master/src/main/java/org/datanucleus/api/jdo/state

I'd guess you need to look at class PersistentNew.java (the state the object is in) and look for a method transitionRefresh(), which looks like it uses the default implementation (do nothing) currently.


FYI DataNucleus JPA has an equivalent set of Lifecycle states over in "datanucleus-api-jpa", so if changing anything in the lifecycle states for JDO (in datanucleus-api-jdo) then this will not affect DataNucleus JPA usage (a good thing).


Beyond those, some other classes that you may need to be aware of are
ExecutionContext (does the work of the PM), here
https://github.com/datanucleus/datanucleus-core/blob/master/src/main/java/org/datanucleus/ExecutionContextImpl.java

Transaction (for the ExecutionContext)
https://github.com/datanucleus/datanucleus-core/blob/master/src/main/java/org/datanucleus/TransactionImpl.java



Hope that helps
-- 
Andy
DataNucleus (Web: http://www.datanucleus.org   Twitter: @datanucleus)

JIRA 747

Posted by Tilmann Zäschke <za...@gmx.de>.
Hi Andy,

(sorry for double posting, I sent this to andyj@apache.org before)

I started looking into adapting datanucleus for JDO JIRA 747: 
https://issues.apache.org/jira/browse/JDO-747

Some time ago you offered to give some initial pointers, could you tell 
me where to start?

My first goal: Update datanuclues so that a PERSISTENT_NEW object 
transitions to PERSISTENT_CLEAN when they are refreshed _and_ if there 
is an object with the same ID in the database.

I tried to find the state transition checks and triggers. I first looked 
into datanucleus' Transaction.commit(), but it seems to forward 
everything to an implementation of XAResource.commit, probably either 
one of the LocalXAResource or the EmulatedXAResource classes. These 
forward the call to a 'Connection', but I can't immediately see which 
implementation is used.

Could you give me some pointers?

Thanks,
Tilmann