I'm trying to convert a finder that used SQL to using dynamic-ql. When called by itself it works. When it's used in a transaction with calls to the entities that it returns I get a
java.lang.IllegalStateException: removing bean lock and it has tx
when a gettter method on the returned entities is called.
I've seen the posts about problems with primary keys and about upgrading JBoss. The primary key field type is java.lang.String and I'm using JBoss 3.06, so I don't think this is the problem.
The error occurs when I call a stateless session bean method with transaction REQUIRED configured. The dynamic-ql finder its calls has transaction SUPPORTS, and the method on the returned entities that is called also has transaction SUPPORTS.
I really like to use dynamic-ql rather than raw SQL. Any ideas on what the problem might be would be appreciated.