-
How can EJB Container guarantee threads safety? (8 messages)
- Posted by: Guotong Xie
- Posted on: June 09 2003 22:35 EDT
I.e. a session bean performing an important and complex banking operation, then how can container guarantee the integrality of the key operation when more than one client access the same session bean? I think probably all concurrency control problem can boil down to a problem of entity bean, for session bean means business logic which has no need to worry about concurrency problem unless entity bean appears. Transaction may be a possible solution.Threaded Messages (8)
- How can EJB Container guarantee threads safety? by Mohit Jain on June 10 2003 00:55 EDT
- How can EJB Container guarantee threads safety? by Guotong Xie on June 10 2003 01:12 EDT
- How can EJB Container guarantee threads safety? by Wallace Zou on June 10 2003 01:14 EDT
- EJB Container providing thread security by supraja madhavi on June 10 2003 08:36 EDT
- How can EJB Container guarantee threads safety? by Guotong Xie on June 10 2003 01:12 EDT
- How can EJB Container guarantee threads safety? by Gunther Van Roey on June 10 2003 02:55 EDT
- How can EJB Container guarantee threads safety? by Guotong Xie on June 10 2003 04:16 EDT
- Use suitable isolation level by Andrew Fu on June 10 2003 12:04 EDT
- How can EJB Container guarantee threads safety? by Eric Ma on June 10 2003 01:21 EDT
- How can EJB Container guarantee threads safety? by Guotong Xie on June 10 2003 04:16 EDT
-
How can EJB Container guarantee threads safety?[ Go to top ]
- Posted by: Mohit Jain
- Posted on: June 10 2003 00:55 EDT
- in response to Guotong Xie
By using Transactions and defining the Isolation level you can achieve the desired safety. -
How can EJB Container guarantee threads safety?[ Go to top ]
- Posted by: Guotong Xie
- Posted on: June 10 2003 01:12 EDT
- in response to Mohit Jain
By using Transactions and defining the Isolation level you can achieve the desired safety.
Thanks for your reply.However,I'm not quite clear about the expense of Transaction.Performance is the key design issue in my project. -
How can EJB Container guarantee threads safety?[ Go to top ]
- Posted by: Wallace Zou
- Posted on: June 10 2003 01:14 EDT
- in response to Guotong Xie
I think, there is no way to get win win in transaction and performance.
Regards,
Wallace -
EJB Container providing thread security[ Go to top ]
- Posted by: supraja madhavi
- Posted on: June 10 2003 08:36 EDT
- in response to Mohit Jain
"Ejb container provides scurity by default.If a client is accessing an instance
it locks it untill it completes utilization,by passivating or removing.
By definiing isolation it can provide this.Two of the best isolation levels are TRANSACTION_READ_UNCOMMITED,TRANSACTION_SERIALIZABLE " -
How can EJB Container guarantee threads safety?[ Go to top ]
- Posted by: Gunther Van Roey
- Posted on: June 10 2003 02:55 EDT
- in response to Guotong Xie
As per the spec, no two threads will ever access the same EJB bean instance at the same time (neither session, nor entity).
This removes the risk of threading-unsafe code in an EJB.
So, if you write a Session EJB, no two threads will ever be executing code in the same instance of the bean. -
How can EJB Container guarantee threads safety?[ Go to top ]
- Posted by: Guotong Xie
- Posted on: June 10 2003 04:16 EDT
- in response to Gunther Van Roey
You are right.But what frighten me is not the fact that two threads will access the same EJB bean instance.In fact,I mean two client threads access two instances of the same EJB bean. -
Use suitable isolation level[ Go to top ]
- Posted by: Andrew Fu
- Posted on: June 10 2003 12:04 EDT
- in response to Guotong Xie
When you have multiple instances of the same entity bean, the concurrency is similar to ordinary Java class. Only, ejb provide deployment descriptor. You need to specify the suitable transaction attributes. -
How can EJB Container guarantee threads safety?[ Go to top ]
- Posted by: Eric Ma
- Posted on: June 10 2003 13:21 EDT
- in response to Guotong Xie
What is your problem in that scenario?