Maybe closer...
"Gonçalo E.D. Luiz" <[email protected]>
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Message-ID | <[email protected]> |
Maybe I'm getting closer to it....
In order to execute a workflow task, we have a Scheduler that creates
new threads (ExecutionElement that implements Runnable).
If I overwrite this behaviour and call the run() method directly all
works well....
However if I let the Scheduler create a new thread, I get the null
ponter exception at the fetch() method.
I've been looking to Database.java and I found out that there are 4
methods being called it it:
TransactionManager transactionManager = env.transactionManager;
Transaction currentTransaction =
transactionManager.currentTA();
ObjectID id = rObj.remoteID();
ObjectContainer container =
currentTransaction.acquireObjectAndPin( id, lockLevel );
I've tried to call remoteID from outsied of the fetch method and I get a
number -> no null pointer here. So we are reduced to 3 methods:
TransactionManager transactionManager = env.transactionManager;
Transaction currentTransaction =
transactionManager.currentTA();
ObjectContainer container =
currentTransaction.acquireObjectAndPin( id, lockLevel );
Every methods here are transaction-related. That makes me wander how
Ozone handles transactions.
So until now, I know two things: the null pointer IS related with new
threads and MAYBE is related with transactions.
So this is what I'm doing:
Create the ozone object -> ok
Create a new "regular" object that implements runnable inside the ozone
object -> ok
Execute a method on the ozone object ->ok
The method launches a new thread -> ok
The new thread tries to fetch an object from the database -> BOOM
I hope this information is usefull.
Best regards,
Gonçalo.
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click