Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

is transaction mess the result?  RSS feed

 
lihui
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i deploy a example of sun's JMS tutorial which contains 3 MDBs and 1 entity bean into weblogic6.1,and find something wrong with it.The process like follows:
the entity bean send a TextMessage to inform a message driven bean listening at a queue,the listener print the message on the console and delete the entity bean send the msg.
error took place beacause after the listener having excecuted ejbRemove,the container calls ejbStore(),which cause a weblogic exception throwed.i think it due to incorrect configuration in the weblogic-ejb-jar.xml. i set<db-is-shared> to be true,<delay-updates-until-end-of-tx> to be true,and<isolation-level> to be TRANSACTION-SERIALIZABLE,and the result is nearly the same.what's wrong with that?
 
Peter Reinhardt
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and what was the exception you got ?
 
James Carman
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by lihui:
hi,
i deploy a example of sun's JMS tutorial which contains 3 MDBs and 1 entity bean into weblogic6.1,and find something wrong with it.The process like follows:
the entity bean send a TextMessage to inform a message driven bean listening at a queue,the listener print the message on the console and delete the entity bean send the msg.
error took place beacause after the listener having excecuted ejbRemove,the container calls ejbStore(),which cause a weblogic exception throwed.i think it due to incorrect configuration in the weblogic-ejb-jar.xml. i set<db-is-shared> to be true,<delay-updates-until-end-of-tx> to be true,and<isolation-level> to be TRANSACTION-SERIALIZABLE,and the result is nearly the same.what's wrong with that?


You're running into a race condition. The entity bean is being removed from the database prior to the execution of the ejbStore() method. You are probably getting a NoSuchEntityException, I would imagine. Maybe you should rethink your design. Typically, entity beans do not perform business logic like this. Entity beans are usually managed by Session beans.
 
lihui
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for James Carman and Peter Reinhard's kindly reply.
Beasause i encounter the problem in my workplace where i have little chance to access internet,i can't give the exact Exception.I remember it's a Exception particular to weblogic,content of which begans with 'no resource found ...'.i agree with James Carman's opinion,it's due to a race condition.what i want to know is can i avoid it by tuning the EJB container to make the underlaid database perform synchronized action.i think there ought to be a mechanism to achive this when bean instances are all in a single container.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!