I have a CMP entity bean that answers all queries and is happy while it is in an active state. I can run a script to call thousands of instances successfully.
If I wait long enough for the beans to passivate, the first time I try to access a bean it will throw the IllegalStateException with the "tx set!" verbiage.
I have read a number of similar posts with this same error, but most of them pertain to situations where the bean will not ever answer queries correctly. In my case, the queries work fine until the bean passivates.
I am using JBoss 3.0.4. Any help would be wonderful, because I am stuck!
I finally figured out the problem I was having with this. I had code in ejbActivate() that was accessing a data member, which is apparently a no-no. I moved it to ejbLoad and I no longer get the error.
After reading more in my EJB book and learning a little more about the entity bean state machine, this looked like the right thing to do.