Hey,
<quote>
Are you trying to use two threads on the same
org.exolab.castor.jdo.Database
instance?
It is not supported.
We assume one-thread per transaction (thus one thread per Database).
Thomas
</quote>
I am using two threads on two different Database instances. I had been
careful to ensure this. Each thread creates its own JDO then its own
Database object from their respective Database objects. Thanks,
Glenn.
-----Original Message-----
From: Russell, Glenn [mailto:[EMAIL PROTECTED]]
Sent: 05 September 2001 10:57
To: [EMAIL PROTECTED]
Subject: [castor-dev] Multi-threading problem...
Hey,
I have a class which spawns two threads which create a JDO object, gets a
database, then performs a Castor query. Problem is, 50% of the time, I get
the following error: -
java.lang.NullPointerException
at
org.exolab.castor.persist.ClassMolder.revertObject(ClassMolder.java:2389)
at
org.exolab.castor.persist.LockEngine.revertObject(LockEngine.java:864)
at
org.exolab.castor.persist.TransactionContext.rollback(TransactionContext.jav
a:1602)
at
org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:502)
at
com.spirentsystems.framework.persistence.tests.castortests.LazyLoad.execute(
LazyLoad.java:88)
at
com.spirentsystems.framework.persistence.tests.castortests.LazyLoad$1.run(La
zyLoad.java:206)
at java.lang.Thread.run(Thread.java:484)
On other occasions, the two threads complete successfully. I was under the
impression that JDO objects are thread-safe?. As both threads create their
own JDO objects, surely then the fact that Database objects are not
thread-safe is not an issue here?. Any information is greatly appreciated,
Glenn.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev