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

EJBTimerServiceImpl should get its TransactionManager via dependency injection

    XMLWordPrintable

Details

    • Workaround Exists
    • Hide

      Add a depends:

      <!-- An EJB Timer Service that is Tx aware -->
      <mbean code="org.jboss.ejb.txtimer.EJBTimerServiceImpl"
      name="jboss.ejb:service=EJBTimerService">
      <attribute name="RetryPolicy">jboss.ejb:service=EJBTimerService,retryPolicy
      =fixedDelay</attribute>
      <attribute name="PersistencePolicy">jboss.ejb:service=EJBTimerService,persi
      stencePolicy=database</attribute>
      <attribute name="TimerIdGeneratorClassName">org.jboss.ejb.txtimer.BigIntege
      rTimerIdGenerator</attribute>
      <attribute name="TimedObjectInvokerClassName">org.jboss.ejb.txtimer.TimedOb
      jectInvokerImpl</attribute>
      <depends>jboss:service=TransactionManager</depends>
      </mbean>

      Show
      Add a depends: <!-- An EJB Timer Service that is Tx aware --> <mbean code="org.jboss.ejb.txtimer.EJBTimerServiceImpl" name="jboss.ejb:service=EJBTimerService"> <attribute name="RetryPolicy">jboss.ejb:service=EJBTimerService,retryPolicy =fixedDelay</attribute> <attribute name="PersistencePolicy">jboss.ejb:service=EJBTimerService,persi stencePolicy=database</attribute> <attribute name="TimerIdGeneratorClassName">org.jboss.ejb.txtimer.BigIntege rTimerIdGenerator</attribute> <attribute name="TimedObjectInvokerClassName">org.jboss.ejb.txtimer.TimedOb jectInvokerImpl</attribute> <depends>jboss:service=TransactionManager</depends> </mbean>

    Description

      This code:

      protected void startService() throws Exception
      {
      // Setup plugins, fall back to safe defaults

      // Get the Tx manager
      try

      { InitialContext iniCtx = new InitialContext(); transactionManager = (TransactionManager)iniCtx.lookup("java:/TransactionManager"); }

      catch (Exception e)

      { log.warn("Cannot obtain TransactionManager from JNDI, using TxManager.getInstance(): " + e.toString()); transactionManager = TxManager.getInstance(); }

      needs to be dropped and the TransactionManager injected via a dependency.

      Attachments

        Activity

          People

            dandread1@redhat.com Dimitrios Andreadis
            starksm64 Scott Stark (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified