1 Reply Latest reply on Aug 1, 2003 2:17 AM by nraghuram

    Drawbacks of using instance per transaction configs

    divine_comedy

      Can anybody tell me the drawbacks of using this configuration for my entity bean ? The only thing I can think of is that there's a probability of getting out of sync data. Is that right ? If so, then it's no good unless if I perform some versioning of my data or if the data is read only. What's the difference between this and using the Optimistic lock ?

        • 1. Re: Drawbacks of using instance per transaction configs
          nraghuram

          The drawback is that every time the entity is used in a new transaction the database is queried.
          Lock and IPT are two separate things.
          You can have IPT with a pessimstic lock or an optimistic lock.
          IPT only means that there are multiple instances of the entity bean, for that particular primary key, in existence.
          Optimistic lock means that you assume no other transaction has modified the data between the time your transaction loaded it and commited it. This is achieved by using a version number, timestamp etc.
          Whereas with a pessimistic lock the row cannot be updated by any other transaction till your transaction completes.