1 Reply Latest reply on Dec 21, 2011 2:04 AM by wdfink

    How to properly lock a table (row) across a cluster with EJB 3.1

    kajn

      Hi all,

       

      We're writing some code that has the potential for multiple threads in one server to access the same set of rows of data, possibly updating them. More so we know that when we add more servers to the cluster, each server could be accessing the same set of rows in a table, possibly each via multiple threads. I can't seem to find much good info with regards to using entity beans and read/write locks. This is new territory for us as thus far we've been working on a prototype and now we're gaining some traction and all the issues of scaling are creeping up on us. I can't find any books at all on the area of JEE 6 clustering/scalability.. I realize each server does it differently (too bad JEE6 didn't define a standard scalability mechanism). We're using GlassFish 3.1 right now but are going to be switching to JBoss 7 as soon as we can. Regardless of the container, the use of entity bean locking I assume is what we need to use? Does entity bean locking apply to the db table/row, or is it only the object in memory on a specifid container?

       

      Any links to info or experience would be fantastic on the subjects.

       

      Thank you.