1 Reply Latest reply on Jun 28, 2003 4:26 PM by G.C. MIller

    Problem with multiple clients and entity beans.

    G.C. MIller Newbie

      If I have two clients accessing the same entity bean at the same time and they change the enitity bean, I get bad data. Example account entity bean with a function that transfers money, by adding or subtracting a value from the balance field. If the balance = 40 and two clients at the same time subtract 20 the balance should be 0, however it is coming back 20. The deployment descriptor is set to have transactions required for all methods. I thought about synchronizing on the ejb before the method changes the balance field but what about in a cluster, where that wont work if both clients have ejb's from different servers representing the same database record? Any ideas?