Hi,
I've just started out with Castor (v0.9.3 web release), and while I have it working fine for the core functionality, I've had the following problems:
1) if I start a transaction, create an object, then rollback, like so:
db.begin();
db.create(object);
db.rollback();
The object exists - ie create is not rolled back.
2) if I create an object, commit the transaction, then create another with the same primary key, it appears to succeed (no exception is thrown), but nothing is inserted into the database. Sample code:
object = new MyObject( 1, "test object" );
db.begin();
db.create(object);
db.commit();
object = new MyObject( 1, "conflict object" );
db.begin();
db.create(object); <-- expect org.exolab.castor.jdo.DuplicateIdentityException here
db.commit();
3) similarly to above, if I remove an object then try and remove it again, it doesn't throw an exception
db.begin();
object = db.load( MyObject.class, new Integer( 6 ));
db.remove( object );
db.commit();
object = new MyObject( 1, "conflict object" );
db.begin();
object = db.load( MyObject.class, new Integer( 6 )); <-- expect org.exolab.castor.jdo.ObjectNotFoundException here
db.remove(object);
db.commit();
It appears to me that some changes aren't being reflected immediately from cases 2 & 3.
4) This may be related - I am not using db.close() anywhere. I tried and I get TxClosedRolledBackException (or something similar - can't remember now).
I only have one call to jdo.getDatabase() - should the db.close() match this? Why would I get the exception I mentioned?
Thanks in advance.
Regards,
Brett
~*~*~*~*~*~*~
Brett Porter
Web Developer, f2 Fairfax Interactive Network, Australia
Ph: +61 2 8596 4437
Email: [EMAIL PROTECTED]
