This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB transaction " Watch "EJB transaction " New topic

EJB transaction

happy cheng

Joined: Jul 01, 2008
Posts: 2
in the servlet there is following method:

ejbRequiredCall() is an ejb call that specify transaction as Required, which run some db transaction.
my question is, for the looping part, every ejbRequiredCall will be a separated transaction, right? or it will fall into one transaction. Thanks.
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
You transaction starts when the EJB method is started. So each call to the EJB method will be in a diff transaction.


Amit Tank
Linked In
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3749

"Happy cheng"

Please review The JavaRanch naming policies, as your name appears to be clearly fictitious.

To your question, what exactly is ejbRequiredCall? Also, I'm not sure why you're starting threads in J2EE or EJB, its considered a bad practice to be doing any kind of thread management in such an environment (thats what the server is for).

To Amit, why would each call to an ejb create a transaction? It all depends how the EJB transaction attributes are configured for the ejb. Maybe there's part of this question I'm missing.

[OCA 8 Book] [Blog]
happy cheng

Joined: Jul 01, 2008
Posts: 2
Thanks, Amit. That's what I thought but need confirm.
To Scott,
1. my name was taken by others, it seems this forum forbid two people use same name , so what's better the sounded real fake name and my current one.
2. ejbRequiredCall is an ejb call which defined as transaction 'Required'
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: EJB transaction
It's not a secret anymore!