-
1. Re: Transactions? When to use them on session beans
adrian.brock Aug 21, 2002 8:54 AM (in response to cyates)One of the main points to the session facade
is to wrap a group of entity operations in one
transaction local to the server. The session facade
starts the transaction.
Use Required on all methods in the facade to achieve
this.
Technically the spec says you have to declare the
transactions for a session bean. JBoss defaults to
Required if you forget.
For portability make it explicit.
Regards,
Adrian -
2. Re: Transactions? When to use them on session beans
cyates Aug 21, 2002 9:07 AM (in response to cyates)Thanks for your reply.
What about if I have a method on a session (stateless) that executes some SQL on the server, then creates an entity bean.
The situation I am talking about is for logging, we only want to record the last 300 activities so I create the activity using an entity bean then I execute some SQL.
Do I have to wrap my SQL/JDBC call in it's own transaction or is this magically done for me?
Thanks again -
3. Re: Transactions? When to use them on session beans
adrian.brock Aug 21, 2002 11:17 AM (in response to cyates)Assuming you are using a managed connection
(from your configured DataSource in JNDI) to
perform your SQL, JBoss will associate the connection
with the transaction the session bean started.
Regards,
Adrian