0 Replies Latest reply on Feb 19, 2004 3:44 AM by kiruxa

    ejbLoad synchronization issue

    kiruxa Newbie

      I've encountered a problem with jboss 3.0.7, but according to CVS
      the same would be in latest release. I've got BMP entity bean, standard
      configuration. Two clients access the same instance of bean without
      transaction. I saw in logs the following:

      client1: EntitySynchronizationInterceptor.invoke, ctx.isValid == false
      client1: ejbLoad started
      client1: ejbLoad finished, ctx.isValid == false
      client2: EntitySynchronizationInterceptor.invoke, ctx.isValid == false
      client2: ejbLoad started
      client1: ctx.isValid == true
      client1: business method

      Here my business method fail, because ejbLoad in another thread is
      modifiyng bean's internal state. I thought that container should
      serialize calls to the same instance of bean, but I'm not sure that
      this is the only one possible interpretation of spec. As for me, I'd put call
      to ejbLoad in EntitySynchronizationInterceptor.invoke into
      synchronized(ctx) block. In fact, I already tried to do so and everything works fine