Title: RE: [jBoss-User] BMP and Container Managed Transactions
Hello all,
 
In Castor JDO, I'm getting an java.lang.IllegalStateException when commiting after storing an object to the database.  I'm using Castor 0.8.11 under Windows NT with mysql 3.23.30 and mm.mysql 2.0.2 jdbc drivers. 
 
Specifically, when I do this:
 
    JDO jdo=new JDO("test");
    jdo.setConfiguration("database.xml");
    Database db=jdo.getDatabase();
    db.begin();
    db.create(asset);
    db.commit();
This is thrown:
 
Transaction aborted: java.lang.IllegalStateException: Internal error in persistence layer: Attempt to store object for which no lock was acquired
java.lang.IllegalStateException: Internal error in persistence layer: Attempt to store object for which no lock was acquired
        at org.exolab.castor.persist.CacheEngine.store(CacheEngine.java:1049)
        at org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java:954)
        at org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:433)
        at castortest.AssetStore.jdoTest(AssetStore.java:67)
        at Castor.doSomething(Castor.java:119)
        at Castor.main(Castor.java:135)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.borland.jbuilder.util.BootStrap.invokeMain(Unknown Source)
        at com.borland.jbuilder.util.BootStrap.main(Unknown Source)
 
(I believe my mapping and database xml files are correct).
 
This also occures with mysql 3.23.21... and when I use the same object with a mysql db, mm.mysql and 0.8.11 under linux.
 
Has anyone run into this before?  Any suggestions?ls
 
andy

Reply via email to