1 2 Previous Next 16 Replies Latest reply on Sep 16, 2008 3:24 PM by aguizar

    Multiple 1PC resources in enterprise

    thomas.diesler

      Alejandro,

      https://jira.jboss.org/jira/browse/JBPM-1708

      If I understand you correctly, you associated the DS for the TimerEntityBean with the JbpmDS to share the same DS with the rest of the engine and not have multiple 1PC resources enlisted.

      <jbosscmp-jdbc>
       <defaults>
       <datasource>java:/JbpmDS</datasource>
       <create-table>false</create-table>
       <remove-table>false</remove-table>
       <pk-constraint>false</pk-constraint>
       </defaults>
      
       <enterprise-beans>
       <entity>
       <ejb-name>TimerEntityBean</ejb-name>
      


      Using the same DS for all DB related stuff seems correct to me.

      The EjbSchedulerTest however still fails

      Running org.jbpm.scheduler.ejbtimer.EjbSchedulerTest
      Tests run: 6, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 9.431 sec <<< FAILURE!
      
      Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:bb20:48c8d180:55 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:bb20:48c8d180:55 status: ActionStatus.ABORT_ONLY >)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
      


      There seems to be more to it than sharing the DS.

        • 1. Re: Multiple 1PC resources in enterprise
          thomas.diesler

          BTW, why is the timer using jboss-4.0 style CMP and not EJB3?

          If there is no compelling reason, we should migrate simply because folks pick up from what we provide.

          • 2. Re: Multiple 1PC resources in enterprise
            kukeltje

            Not all containers support EJB3, and it is, or at least was, the intention to be able to run in multiple containers. Same reason JDK1.4 is (was?) still the default target jdk.

            Maybe an additional profile can be made with an EJB3 config so people can choose

            • 3. Re: Multiple 1PC resources in enterprise
              thomas.diesler

              The jBPM target containers are documented here

              http://jbpm.dyndns.org/jbpmwiki/index.php?title=JBPM3SupportedTargetContainers

              for jbpm-3.3.0 we don't target any other containers than these.

              What you say about EJB3 is certainly also true, likely even more so, for CMP.

              • 4. Re: Multiple 1PC resources in enterprise
                kukeltje

                Yes, I know the list, but that does not say anything about the jdk does it? 4.2.2 runs with 1.4 afaik, but for ejb3 you need at least 1.5. So either the list should be extended with a jdk version or restrictions should be applied.

                Maybe there should be a link on this wiki as well to the pre 3.3 releases and know-to-be-running containers.

                • 5. Re: Multiple 1PC resources in enterprise
                  thomas.diesler

                  I added a comment on jdks and jbpm-3.2.3 to the wiki.

                  • 6. Re: Multiple 1PC resources in enterprise
                    aguizar

                     

                    If I understand you correctly, you associated the DS for the TimerEntityBean with the JbpmDS to share the same DS with the rest of the engine and not have multiple 1PC resources enlisted.

                    The DS for the TimerEntityBean must be the JbpmDS, otherwise the whole thing does not work :-) In JBPM-1708 I meant the DS for the EJB timer service itself, tough. When the EntitySchedulerService creates an EJB timer, the data source specified in ejb2-timer-service.xml (JBoss 5) or ejb-deployer.xml (JBoss 4) enters the scene.
                    <mbean code="org.jboss.ejb.txtimer.DatabasePersistencePolicy" name="jboss.ejb:service=EJBTimerService,persistencePolicy=database">
                     <!-- DataSourceBinding ObjectName -->
                     <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=JbpmDS</depends>
                     <!-- The plugin that handles database persistence -->
                     <attribute name="DatabasePersistencePlugin">org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin</attribute>
                     <!-- The timers table name -->
                     <attribute name="TimersTable">EJB_TIMER</attribute>
                     <depends>jboss.jdbc:datasource=JbpmDS,service=metadata</depends>
                     </mbean>

                    If set to a data source other than JbpmDS, multiple 1PC problems happen. Another option is to enable multiple last resource enlistment in the transaction service. But that might result in inconsistent rollbacks, which would be very bad when coupled with optimistic locking exceptions.

                    • 7. Re: Multiple 1PC resources in enterprise
                      aguizar

                      I like the EJB3 profile proposal. Whether it should be in lieu of EJB2 is a question to be asked to the community. For now however, we should focus on getting 3.3.0.CR out :-)

                      • 8. Re: Multiple 1PC resources in enterprise
                        kukeltje

                        Great, thanks Thomas. May I conclude that jBPM is now (un)officially not supported anymore on JDK 1.4 with the upcomming 3.3 release?

                        Might be something specifically for the releasenotes

                        • 9. Re: Multiple 1PC resources in enterprise
                          thomas.diesler
                          • 10. Re: Multiple 1PC resources in enterprise
                            thomas.diesler

                             

                            Another option is to enable multiple last resource enlistment in the transaction service.


                            This is in fact not an option ;-)


                            • 11. Re: Multiple 1PC resources in enterprise
                              kukeltje

                              Hahaha... it can indeed be that simple but...In the anouncement when 3.3 comes out, I'd put a little more focus on this....

                              • 12. Re: Multiple 1PC resources in enterprise
                                tom.baeyens

                                on the migration to ejb3: i don't think that is appropriate on jBPM 3. we can consider this on jBPM 4.

                                on the tx issue: i didn't quite get it yet. i would guess the whole purpose of an appserver is to take care of making a global transaction out of XA transactional resources, no ? even if we would use different DSs.

                                on java 1.4: i think we can drop 1.4 in 3.3.0 since we increased the minor version number

                                • 13. Re: Multiple 1PC resources in enterprise
                                  aguizar

                                   

                                  on the migration to ejb3: i don't think that is appropriate on jBPM 3. we can consider this on jBPM 4.

                                  +3.1415926
                                  ejb3 is definitely a proposal for jbpm 4. I volunteer for that.
                                  i would guess the whole purpose of an appserver is to take care of making a global transaction out of XA transactional resources, no ? even if we would use different DSs.

                                  managing a global/distributed transaction is the app server's business indeed, except that (1) some databases such as HSQL and (correct me if I'm wrong) MySQL do not provide XA data sources and (2) the EJB timer service's support for 2PC relies on its underlying data source, which affects the EntitySchedulerService. JMS's 2PC support does not rely on the underlying data source's XA capability and therefore the JmsMessageService is unaffected.

                                  • 14. Re: Multiple 1PC resources in enterprise
                                    tom.baeyens

                                     

                                    i would guess the whole purpose of an appserver is to take care of making a global transaction out of XA transactional resources, no ? even if we would use different DSs.

                                    managing a global/distributed transaction is the app server's business indeed, except that (1) some databases such as HSQL and (correct me if I'm wrong) MySQL do not provide XA data sources and (2) the EJB timer service's support for 2PC relies on its underlying data source, which affects the EntitySchedulerService. JMS's 2PC support does not rely on the underlying data source's XA capability and therefore the JmsMessageService is unaffected.

                                    1 2 Previous Next