Hi everyone,
Something i'am worry about with my BMP (TX_REQUIRED demarcation), accessed by a transactional method (I'll write explicitly the transaction boudaries)
Let's say we have BMP entity A, with LocalHomeInterface HA and LocalInterface LA
{
Transaction begin
HA ha;
LA la;
la = <...> ha.ejbFindByPrimaryKey();
la.set1();
la.set2();
Collection col = ha.findAll<...>();
Transaction Rollback
}
In this case, I would expect thet set1() and set2() has no effect in database since the transaction rolled back, BUT since the ejbFind method causes the container to call ejbWrite , data have changed in the database !
Isn't that a real problem ? Or I missed something ?
Thanks
-
Transaction and BMP ejbFind conflict (5 messages)
- Posted by: Arnaud G
- Posted on: October 23 2002 08:39 EDT
Threaded Messages (5)
- Transaction and BMP ejbFind conflict by Arnaud G on October 23 2002 09:50 EDT
- Transaction and BMP ejbFind conflict by Dave Wolf on October 23 2002 10:40 EDT
- Transaction and BMP ejbFind conflict by Arnaud G on October 23 2002 11:45 EDT
- Transaction and BMP ejbFind conflict by Marco Ingco on October 23 2002 17:06 EDT
- Transaction and BMP ejbFind conflict by Arnaud G on October 24 2002 05:08 EDT
-
Transaction and BMP ejbFind conflict[ Go to top ]
- Posted by: Arnaud G
- Posted on: October 23 2002 09:50 EDT
- in response to Arnaud G
Yes.. I missed that "Rollback" not only prevent data in cache to be written, but also ask DB ResourceManager to rollback ...
Arnaud
"Aide-toi, et le Ciel t'aidera"
-
Transaction and BMP ejbFind conflict[ Go to top ]
- Posted by: Dave Wolf
- Posted on: October 23 2002 10:40 EDT
- in response to Arnaud G
Remember that transactions are set on a per method level. Did you set the tx properties for every method of the entity bean?
Dave Wolf
Personified Technologies LLC -
Transaction and BMP ejbFind conflict[ Go to top ]
- Posted by: Arnaud G
- Posted on: October 23 2002 11:45 EDT
- in response to Dave Wolf
Yes, but the question was theorical : "the data have changed" meant "the data would change when this piece of code will be executed", which is not true (i think) since the DBRM is able to rollback the SQL command triggered by ejbWrite()
-
Transaction and BMP ejbFind conflict[ Go to top ]
- Posted by: Marco Ingco
- Posted on: October 23 2002 17:06 EDT
- in response to Arnaud G
Please tell me how your ejbFind method caused a change in you database. -
Transaction and BMP ejbFind conflict[ Go to top ]
- Posted by: Arnaud G
- Posted on: October 24 2002 05:08 EDT
- in response to Marco Ingco
ejb 2.0 spec says :
"Before invoking the ejbFind<METHOD>(...) method,the container must therefore first synchronize the state of any entity bean instances that are participating in the same transaction context as is used to execute the ejbFind<METHOD>(...) by invoking the ejbStore() method on those entity bean instances."
and in ejbStore() { (...) connection.prepareStatement("update ...") ...executeUpdate(); }