[jboss-user] [EJB/JBoss] - Re: Singleton EJB

fisherv@teoco.com do-not-reply at jboss.com
Tue Nov 21 16:26:25 EST 2006


Are the objects in the "single set accessed by all clients" ever persisted?  If so, the DB itself should be your single set accessed by all clients.  Then you can allow any number of  EJB instances from a pool to access the same DB table(s) at the same time.  For reading, you don't care how many readers there are.  If multiple writers are creating new objects, that's ok - different ids will be assigned to each by your id generation strategy.  If multiple writers are attempting to update the same object at the same time, you need to use optimistic locking (by a timestamp or version attribute) or pessimistic locking (rarely used) to prevent losing changes.  

Forcing all activity to go through a single EJB is not scalable performance-wise and may also may cause memory issues if the set grows too large.  

Good luck!






View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3987723#3987723

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3987723



More information about the jboss-user mailing list