Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3717

correct TCL should be used before starting entity PMs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBossAS-4.0.5.GA
    • JBossAS-3.2.8.SP1, JBossAS-4.0.5.CR1
    • EJB2
    • None

    Description

      In EjbModule before starting persistence managers for entity beans, correct thread class loader should be set. Like so
      protected void startService() throws Exception
      {
      // before EntityContainer returns from the startService, its PM should be usable
      ListIterator iter = containerOrdering.listIterator();
      while( iter.hasNext() )
      {
      Container con = (Container) iter.next();
      if(con.getBeanMetaData().isEntity())
      {
      ClassLoader oldCl = SecurityActions.getContextClassLoader();
      SecurityActions.setContextClassLoader(con.getClassLoader());

      try

      { ((EntityContainer)con).getPersistenceManager().start(); }

      finally

      { // Reset classloader SecurityActions.setContextClassLoader(oldCl); }

      }
      }
      ...

      Attachments

        Activity

          People

            olubyans@redhat.com Alexey Loubyansky
            olubyans@redhat.com Alexey Loubyansky
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: