[jboss-jira] [JBoss JIRA] Created: (JBAS-4618) Thread context classloader not set during transaction commit

Elias Ross (JIRA) jira-events at lists.jboss.org
Tue Aug 21 13:10:19 EDT 2007


Thread context classloader not set during transaction commit
------------------------------------------------------------

                 Key: JBAS-4618
                 URL: http://jira.jboss.com/jira/browse/JBAS-4618
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
            Reporter: Elias Ross


I modified a serializable object, part of an EJB3 Entity, during an MDB.onMessage() call. Hibernate attempts to update this serializable object during the transaction commit, but fails because it cannot load the class from the classloader. For example, if one modifies an entity such as:

@Entity
public class Foo {
  Serializable bar;
...
}

in an MDB

public class MDB implements MessageListener {
  @PersistenceContext
  EntityManager em;
  public void onMessage() {
    Foo f = em.load(...);
    f.setBar(new ScopedClass());
  }
}

you get this error.

The thread context classloader is assigned when processing the message. Is it cleared after message processing or after transaction completion? From my limited understanding of the code, it seems like the former. There appears to be an invoker that sets and clears during processing, but the clear apparently happens before transaction commit.

Ordinarily, transaction commit does not require the context classloader of the .ear file, but in this case it does.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list