8 Replies Latest reply on May 2, 2002 11:26 AM by ademelt

    Commit Option C and ejbLoad()

    niklaus

      Hi

      We try commit option C with a BMP Entity Bean and
      ejbLoad() is not ALWAYS called at the beginning of a new transaction - especially if the next transaction comes very short after the first one.

      According to our documentation there should ALWAYS be an
      ejbActivate()/ejbLoad() when an Entity Bean is used in a
      new transaction.

      Are we doing something wrong or is this the standard behaviour?

      Thanks Niklaus

        • 1. Re: Commit Option C and ejbLoad()
          dsundstrom

          You are correct. I would check to see if you are actually in the same transaction (get the transaction from the transaction manager and print the hashcode). My guess is you have not exited the outer most transaction.

          Other wise file a bug report at sourceforge.

          • 2. Re: Commit Option C and ejbLoad()
            ddeuchert

            We are seeing the same behavior when we invoke a BMP entity bean from a client application (in our test suite). The ejbLoad method seems to be invoked inconsistently. The following assertion results in intermittent failures

            {
            ...
            Book book = bookHome.create();

            book.setName("");
            assertNull(book.getName()); // If we get an ejbLoad this
            //value would be null
            ...
            }

            We have no user transaction active so each call on the entity is invoked in a separate transaction.

            This looks like a defect to me... Has it been logged?

            • 3. Re: Commit Option C and ejbLoad()
              ademelt

              We have the same problem. Our commit-option-C entity bean is not ejbLoad()ed when invoking a method outside a transaction context.

              This is because jboss removes the entity bean from the cache only after the transaction has completed (as stated by the spec). The case when running without a transaction remains unspecified and unhandled. Thus, the container still treats the bean as valid for the next method invocation.

              The same problem should apply to commit-option-B entity beans, but we haven't checked this.

              Hey JBoss developer(s): We have implemented a fix for this problem and it seems to work in our case, but I don't have the time and deeper knowledge of JBoss in order to handle this correctly. Please contact me so we can discuss the details.

              • 4. Re: Commit Option C and ejbLoad()
                oravecz

                We are also experiencing intermittent behavior. We use commit option C, and the ejbLoad() method is sometimes not called when the entity is first enlisted into a new transaction.

                Using the current head (jBoss 3.1 alpha).

                • 5. Re: Commit Option C and ejbLoad()
                  dsundstrom

                  If you want this fixed you need to post a bug report with a testcase, otherwise this issue will disappear into the ether.

                  • 6. Re: Commit Option C and ejbLoad()
                    oravecz

                    Dain, these intermittent problems are the toughest to isolate into a neat test case. Perhaps, it would be easier to isolate a bug in the code by analyzing it. Can you relate the classes that one may look at that control when and under what circumstances ejbLoad() is invoked?

                    • 7. Re: Commit Option C and ejbLoad()
                      dsundstrom

                      I think this is an interaction between the cache and the EntityInstanceInterceptor, but this is outside of my area of expertise.

                      I would bet you could just create a couple of clients that set instance variables in a commit option C bean to see interaction.

                      If you can't create a testcase, just create a detailed bug report.

                      • 8. Re: Commit Option C and ejbLoad()
                        ademelt