RE: makeTransactional

David --
This is an excellent question. I believe that Kodo's behavior is
correct; i.e. that calling makeTransactional() on a persistent
non-transactional instance during an optimistic transaction does not
guarantee that the state of the instance is compared to that of the data
store. However, my evidence for this is a little shaky:
Section 5.8 of the JDO specification covers optimistic transactions.
Check out p. 40 and 41 where the makeTransactional() method is
discussed. Only for persistent dirty instances does the spec say the
state of the instance is verified against the data store during commit.
The spec also mentions that users should call refresh() if they want to
make sure the state of the instance in memory is correct (though
refresh() is an expensive operation).
From the above evidence I believe that p-clean instances are nevercompared to the datastore for consistency. But as I noted, this isn't a
whole lot to go on, so I could be wrong. I encourage you to contact the
JDO spec team about the issue... or if you don't we on the Kodo team
will get around to it eventually.
Let us know if you get any clarification!
-- Abe White
-----Original Message-----
From: David Ezzio
To: Tech Trader JDO List
Sent: 8/12/01 4:59 PM
Subject: makeTransactional
Concerning the makeTransactional() method, the spec (V 0.95 p 79) says,
"These methods are also used to mark a nontransactional persistent
instance as being part of the read-consistency set of the transaction."
For transactions with optimistic on and nontransactional read on, I took
this statement to imply that a call to makeTransactional would force a
comparison of the age of the object's concurrency field (its optimistic
lock) to the value in the datastore at the time of transaction commit.
I believed that this would occur even if there were nothing dirty to
write in the object or, even, in the transaction. If there were an age
descrepancy with any of the transactional objects, I expected that an
exception would be raised rather than having the transaction commit.
However, I am not seeing the behavior that I expected in Kudo. So my
question is: am I confused or is there a bug?
David

Craig et al.,
We either have confusion on my part, lack of clarity in the spec, or a
bug in Kudo. Can you perform some triage?
Thanks,
David

Similar Messages

  • [RE: makeTransactional] (second attempt)

    Craig et al.,
    We either have confusion on my part, lack of clarity in the spec, or a
    bug in Kudo. Can you perform some triage?
    Thanks,
    David
    "White, Abe" wrote:
    David --
    This is an excellent question. I believe that Kodo's behavior is
    correct; i.e. that calling makeTransactional() on a persistent
    non-transactional instance during an optimistic transaction does not
    guarantee that the state of the instance is compared to that of the
    data store. However, my evidence for this is a little shaky:
    Section 5.8 of the JDO specification covers optimistic transactions.
    Check out p. 40 and 41 where the makeTransactional() method is
    discussed. Only for persistent dirty instances does the spec say the
    state of the instance is verified against the data store during
    commit. The spec also mentions that users should call refresh() if
    they want to make sure the state of the instance in memory is correct
    (though refresh() is an expensive operation).
    From the above evidence I believe that p-clean instances are never
    compared to the datastore for consistency. But as I noted, this isn't
    a whole lot to go on, so I could be wrong. I encourage you to contact
    the JDO spec team about the issue... or if you don't we on the Kodo
    team will get around to it eventually.
    Let us know if you get any clarification!
    -- Abe White
    -----Original Message-----
    From: David Ezzio
    To: Tech Trader JDO List
    Sent: 8/12/01 4:59 PM
    Subject: makeTransactional
    Concerning the makeTransactional() method, the spec (V 0.95 p 79)
    says,
    "These methods are also used to mark a nontransactional persistent
    instance as being part of the read-consistency set of the
    transaction."
    For transactions with optimistic on and nontransactional read on, I
    took
    this statement to imply that a call to makeTransactional would force a
    comparison of the age of the object's concurrency field (its
    optimistic
    lock) to the value in the datastore at the time of transaction commit.
    I believed that this would occur even if there were nothing dirty to
    write in the object or, even, in the transaction. If there were an
    age
    descrepancy with any of the transactional objects, I expected that an
    exception would be raised rather than having the transaction commit.
    However, I am not seeing the behavior that I expected in Kudo. So my
    question is: am I confused or is there a bug?
    David

    Hi David,
    The intent of makeTransactional is to require the implementation to
    check the state of persistent nontransactional instances at commit.
    If this is done without a refresh, then the state of the instance at the
    moment makeTransactional is called is assumed to be the state to be
    checked. If a subsequent refresh is called, then the refreshed state is
    to be checked at commit.
    David Ezzio wrote:
    >
    Craig et al.,
    We either have confusion on my part, lack of clarity in the spec, or a
    bug in Kudo. Can you perform some triage?
    Thanks,
    David
    "White, Abe" wrote:
    David --
    This is an excellent question. I believe that Kodo's behavior is
    correct; i.e. that calling makeTransactional() on a persistent
    non-transactional instance during an optimistic transaction does not
    guarantee that the state of the instance is compared to that of the
    data store. However, my evidence for this is a little shaky:
    Section 5.8 of the JDO specification covers optimistic transactions.
    Check out p. 40 and 41 where the makeTransactional() method is
    discussed. Only for persistent dirty instances does the spec say the
    state of the instance is verified against the data store during
    commit. The spec also mentions that users should call refresh() if
    they want to make sure the state of the instance in memory is correct
    (though refresh() is an expensive operation).
    This paragraph discusses the state transition, but assumes that the
    checking behavior as discussed in 12.5.7 takes place:
    These methods are also used to mark a nontransactional persistent
    instance as being part of the read-consistency set of the transaction.
    In this case, the call must be made in the context of an active
    transaction, or a JDOUserException is thrown.
    And again in 13.5:
    Unmodified instances that have been made transactional will be verified
    against the current contents of the data store, to ensure that the state
    in the data store is the same as the "before image" of the instance in
    the transaction. If any instance is found to have changed, a
    JDOUserException is thrown which contains an array of JDOUserException,
    one for each instance that failed the verification. The optimistic
    transaction is failed. The definition of "changed instance" is a JDO
    implementation choice, but it is required that a field that has been
    changed to different values in different transactions results in one of
    the transactions failing.
    Details of the state transitions of persistent instances in optimistic
    transactions may be found in section 5.8.
    If this is not clear enough, kindly suggest the specific parts of the
    specification that you think should be updated.
    Regards,
    Craig
    >>
    From the above evidence I believe that p-clean instances are never
    compared to the datastore for consistency. But as I noted, this isn't
    a whole lot to go on, so I could be wrong. I encourage you to contact
    the JDO spec team about the issue... or if you don't we on the Kodo
    team will get around to it eventually.
    Let us know if you get any clarification!
    -- Abe White
    -----Original Message-----
    From: David Ezzio
    To: Tech Trader JDO List
    Sent: 8/12/01 4:59 PM
    Subject: makeTransactional
    Concerning the makeTransactional() method, the spec (V 0.95 p 79)
    says,
    "These methods are also used to mark a nontransactional persistent
    instance as being part of the read-consistency set of the
    transaction."
    For transactions with optimistic on and nontransactional read on, I
    took
    this statement to imply that a call to makeTransactional would force a
    comparison of the age of the object's concurrency field (its
    optimistic
    lock) to the value in the datastore at the time of transaction commit.
    I believed that this would occur even if there were nothing dirty to
    write in the object or, even, in the transaction. If there were an
    age
    descrepancy with any of the transactional objects, I expected that an
    exception would be raised rather than having the transaction commit.
    However, I am not seeing the behavior that I expected in Kudo. So my
    question is: am I confused or is there a bug?
    David--
    Craig Russell 650 786-7819
    Architect mailto:[email protected]
    Sun Microsystems, Inc. http://access1.sun.com/jdo

  • BUG? New instances created in jdoPrestore do not get commited

    Any persistent objects created in jdoPrestore() do not get committed to
    database (calling makeTransactional() explicitly does not make any
    difference)

    Just wanted to let you know that this bug as well as the 1-1 relation
    performance problems you were seeing have been corrected internally. The
    next release (sometime next week hopefully) will include the fixes.

  • Exception when call makeNontransactional() on Transient Transactional instance

    this fragment causes exception in Kodo v2.4.1
    Court coo = Court.newInstance();
    jdo.pm().makeTransactional(coo);
    jdo.pm().makeNontransactional(coo); // evict would causes the same error
    jdo.pm().evict(coo);
    javax.jdo.JDOUserException: The instance "class
    peacetech.gao.ogc.gctrack.jdo.Court" of id
    "peacetech.gao.ogc.gctrack.jdo.oid.CourtOid#8852" is not managed by this
    PersistenceManager.
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.checkValid(PersistenceMa
    nagerImpl.java:2234)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makeNontransactionalFilt
    er(PersistenceManagerImpl.java:1268)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makeNontransactional(Per
    sistenceManagerImpl.java:1249)
    at peacetech.gao.ogc.gctrack.Test.main(Test.java:51)
    Exception in thread "main" Process terminated with exit code 1

    Sorry "null" is referenced in the database, but does not exist error does
    not apply - someone was tampering with data
    "Alex Roytman" <[email protected]> wrote in message
    news:[email protected]...
    Transactional Transient instances stays forever in PM's ManagedObjectseven
    if evictAll() is issued and so do all object they reference eating all
    available memory untill garbage collection kicks in.
    and if I keep reading this objects over and over again
    Kodo blows with following error:
    javax.jdo.JDODataStoreException: javax.jdo.JDODataStoreException: Type
    "null" is referenced in the database, but does not exist.
    NestedThrowables:
    java.lang.NullPointerException
    NestedThrowables:
    javax.jdo.JDODataStoreException: Type "null" is referenced in thedatabase,
    but does not exist.
    NestedThrowables:
    java.lang.NullPointerException
    at
    com.solarmetric.kodo.runtime.objectprovider.EagerResultList.<init>(EagerResu
    ltList.java:40)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Re
    sultListFactory.java:75)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:709)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :93)
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:595)
    at peacetech.gao.ogc.gctrack.Test.main(Test.java:51)
    NestedThrowablesStackTrace:
    javax.jdo.JDODataStoreException: Type "null" is referenced in thedatabase,
    but does not exist.
    NestedThrowables:
    java.lang.NullPointerException
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getType(Subcla
    ssProviderImpl.java:122)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getType(Subcla
    ssProviderImpl.java:96)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.loadPrimaryMappings(Cl
    assMapping.java:1034)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.initialize(JDBCStore
    Manager.java:249)
    at
    com.solarmetric.kodo.runtime.StateManagerImpl.loadInitialState(StateManagerI
    mpl.java:174)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(Pers
    istenceManagerImpl.java:1023)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(Persistenc
    eManagerImpl.java:942)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.createFromResultSet(
    JDBCStoreManager.java:762)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager$2.getResultObject(JD
    BCStoreManager.java:717)
    at
    com.solarmetric.kodo.runtime.objectprovider.EagerResultList.<init>(EagerResu
    ltList.java:35)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Re
    sultListFactory.java:75)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:709)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :93)
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:595)
    at peacetech.gao.ogc.gctrack.Test.main(Test.java:51)
    NestedThrowablesStackTrace:
    java.lang.NullPointerException
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getType(Subcla
    ssProviderImpl.java:118)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getType(Subcla
    ssProviderImpl.java:96)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.loadPrimaryMappings(Cl
    assMapping.java:1034)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.initialize(JDBCStore
    Manager.java:249)
    at
    com.solarmetric.kodo.runtime.StateManagerImpl.loadInitialState(StateManagerI
    mpl.java:174)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectByIdFilter(Pers
    istenceManagerImpl.java:1023)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.getObjectById(Persistenc
    eManagerImpl.java:942)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.createFromResultSet(
    JDBCStoreManager.java:762)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager$2.getResultObject(JD
    BCStoreManager.java:717)
    at
    com.solarmetric.kodo.runtime.objectprovider.EagerResultList.<init>(EagerResu
    ltList.java:35)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.ResultListFactory.createResultList(Re
    sultListFactory.java:75)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:709)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :93)
    atcom.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:595)
    at peacetech.gao.ogc.gctrack.Test.main(Test.java:51)
    Exception in thread "main" Process terminated with exit code 1
    "Alex Roytman" <[email protected]> wrote in message
    news:[email protected]...
    this fragment causes exception in Kodo v2.4.1
    Court coo = Court.newInstance();
    jdo.pm().makeTransactional(coo);
    jdo.pm().makeNontransactional(coo); // evict would causes the sameerror
    jdo.pm().evict(coo);
    javax.jdo.JDOUserException: The instance "class
    peacetech.gao.ogc.gctrack.jdo.Court" of id
    "peacetech.gao.ogc.gctrack.jdo.oid.CourtOid#8852" is not managed by this
    PersistenceManager.
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.checkValid(PersistenceMa
    nagerImpl.java:2234)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makeNontransactionalFilt
    er(PersistenceManagerImpl.java:1268)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.makeNontransactional(Per
    sistenceManagerImpl.java:1249)
    at peacetech.gao.ogc.gctrack.Test.main(Test.java:51)
    Exception in thread "main" Process terminated with exit code 1

  • Question about the JDO specification

    Hey,
    I'm testing Kodo transactional behavior and it occurs to me that I'm not
    sure what the correct behavior should be... Does anyone know the answer to
    the following questions:
    1.
    get a PersistenceManager
    start a transaction
    call getObjectById to get an object Foo
    now... JDOHelper.isTransactional ( Foo ) will return... ( true or
    false? )
    2. do steps in part 1.
    call pm.makeTransactional ( Foo )
    get another object, Bar, by calling Foo.getBar ()
    now... JDOHelper.isTransactional ( Bar ) will return... ( true or
    false? )
    The spec seems to say that it depends on whether you are using
    optimistic transactions or not (argh). Sorry if I am repeating already
    asked
    questions, I can't seem to find an earlier post about this. Thanks for the
    help.
    -Eric

    Hi Eric,
    Yup, if the transaction is Optimistic, then the objects fetched by object ID or by a query are
    not made transactional (but they may already be transactional due to prior work within the
    transaction). If the object is changed, then it is made transactional. If the object is passed to
    makeTransactional() then it becomes transactional. If the transaction started is not Optimistic,
    then every object reached that is persistent becomes transactional. This may cause a refresh from
    the datastore. Unmanaged objects (JDO transient) are not subject to these rules, but they also are
    not returned from fetches or queries either.
    David
    Eric Lindauer wrote:
    >
    Hey,
    I'm testing Kodo transactional behavior and it occurs to me that I'm not
    sure what the correct behavior should be... Does anyone know the answer to
    the following questions:
    1.
    get a PersistenceManager
    start a transaction
    call getObjectById to get an object Foo
    now... JDOHelper.isTransactional ( Foo ) will return... ( true or
    false? )
    2. do steps in part 1.
    call pm.makeTransactional ( Foo )
    get another object, Bar, by calling Foo.getBar ()
    now... JDOHelper.isTransactional ( Bar ) will return... ( true or
    false? )
    The spec seems to say that it depends on whether you are using
    optimistic transactions or not (argh). Sorry if I am repeating already
    asked
    questions, I can't seem to find an earlier post about this. Thanks for the
    help.
    -Eric

  • Kodo allows to modify transactional instances outside of transaction bug?

    Court ccc = Court.newInstance();
    jdo.pm().makeTransactional(ccc);
    //Should throw exception but does not
    ccc.setDescription("DDDDDDDDD");

    Court ccc = Court.newInstance();
    jdo.pm().makeTransactional(ccc);
    //Should throw exception but does not
    ccc.setDescription("DDDDDDDDD");You can modify transactional instances outside of transactions.
    Transactional instances are supposed to act just like transient instances
    except that modifications within transactions can be rolled back.

Maybe you are looking for

  • How to download Pages 4.3 to replace the flawed 5.2

    Pages 5.2 may well have a lot of nice new features but given that it is now 30% fatter why has Apple removed essential features without publishing any warning about such excisions. 5.2 is very likely to ruin any 4.3 file you open, worse it stops 4.3

  • Issues in iTunes Store with iTunes for Mac

    Couple issues related to Browse Mode in iTunes Store. Does anyone else find these very annoying? 1. The Back Button in iTunes Store goes back to main Music Screen instead of back to the browser where you left off. Extremely annoying... 2. In browse m

  • Read XML using DB Link

    Gurus, Is it possible to read/write XML using DB Link? If yes please let me know how to achieve this. Thanks in Advance. Venu

  • Changing NLS_LANG Variable

    Pls let me know of how to set the NLS_LANG Variable in my Toad Client. I have to do this since i am not able to view the chinese characters in the data

  • Adprep encountered a Win32 error. Error code: 0x6ba Error message: The RPC server is unavailable.

    I managed to resolve this issue myself but I would like to put the knowledge out there I got the above error when joining a 2012 R2 Standard server to a 2003 Domain. I found the following article which pointed me in the right direction, but didn't re