Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on EJB - entity beans..sequence of update

Status
Not open for further replies.

fixthebug2003

Programmer
Oct 20, 2003
294
US
Hi,
Is there a way to control the sequence of operation of the Entity Beans in EJB.Like I wanted the Delete operations to be performed first, then Add and then Updates..

Currently the EJB container is doing it in random order...which cause integrity problems in the database..!

Fixthebug2003
 
Yeah ... don't use EJB & use stored procs instead - its a lot more efficient aswell ! :)

As I understood it, one of the "features" of EJB is asynchronous transactions ... basically because of the multithreaded nature of internal EJB container implementations. Its like asking how to stop a car from revving when you pull the choke - its not something you do. If you use EJB, you should be aware that synchronous transactions are part of the "design".

Having said that, there are probably many *frigs* you could do, from locking db tables at the db server level, to
creating a static class to facilitate syncronisation.

But my advice is this - don't use EJB if you need syncronization, because you are trying to make a round wheel go through triangles !





--------------------------------------------------
Free Database Connection Pooling Software
 
So does this mean that if we need to have Transactions in our application as well as syncronization then do not use Entity Beans ...but rather use Stored Procedures..?

If we use Stored Procedure then we should be able to make those as part of the Transactions..right?
(Not used that before)

Thanks
Fixthebug2003
 
I'm saying that AFAIK, EJB does not lend itself well to synchronous transactions.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top