How do i synchronize read/write access to a class variable in a stateless session bean!
I dont want to use a stateful session bean.
-
Synchronization in Stateless EJBs (4 messages)
- Posted by: Sid Bhat
- Posted on: May 07 2003 09:57 EDT
Threaded Messages (4)
- Synchronization in Stateless EJBs by Thomas Risberg on May 07 2003 10:43 EDT
- Synchronization in Stateless EJBs by Sid Bhat on May 07 2003 12:55 EDT
- Synchronization in Stateless EJBs by mohamed rafi on May 08 2003 01:50 EDT
- Synchronization in Stateless EJBs by Sid Bhat on May 07 2003 12:55 EDT
- not recommended by anil deshmukh on May 08 2003 08:06 EDT
-
Synchronization in Stateless EJBs[ Go to top ]
- Posted by: Thomas Risberg
- Posted on: May 07 2003 10:43 EDT
- in response to Sid Bhat
How do i synchronize read/write access to a class variable in a stateless session bean!
You should not write to static variables in an EJB. This has been a restriction in the spec for a long time. Here it is from the latest EJB spec (25.1.2 Programming Restrictions in EJB 2.1 PFD):
An enterprise Bean must not use read/write static fields. Using read-only static fields is allowed. Therefore, it is recommended that all static fields in the enterprise bean class be declared as final. -
Synchronization in Stateless EJBs[ Go to top ]
- Posted by: Sid Bhat
- Posted on: May 07 2003 12:55 EDT
- in response to Thomas Risberg
How do i implement Thread/Resource pooling logic using stateless beans!! -
Synchronization in Stateless EJBs[ Go to top ]
- Posted by: mohamed rafi
- Posted on: May 08 2003 01:50 EDT
- in response to Sid Bhat
Hi,
As per EJB, Programmers should not worry about all the middler tier services and should concentrate on the business logic. Hence there are so many products in the market which provides the services.
Cheers
Rafi -
not recommended[ Go to top ]
- Posted by: anil deshmukh
- Posted on: May 08 2003 08:06 EDT
- in response to Sid Bhat
Ejb Specification dose not recommend to use sychronization,createtion of threads stuff,as application server takes care of this issues.
:)Anil