13 Replies Latest reply on Apr 30, 2002 2:23 PM by davidjencks

    New local tx wrapper in 3.1 head

    davidjencks

      Some problems showed up with the old wrapper not supporting connection association, making it so you couldn't hold a connection while you called another ejb. I wrote a new one. Read all about it at change note 546958.

      http://sourceforge.net/tracker/index.php?func=detail&aid=546958&group_id=22866&atid=381174

      Right now it is only in 3.1 head however I am considering merging it into 3.0 since the problem it solves is pretty important.

      In 3.1, the hsqldb service uses it.

      Feedback welcome.

      david jencks

        • 1. Re: New local tx wrapper in 3.1 head
          mattbaird

          I'm unclear on whether or not this applies to all JCA's that use local transactions, or just ones using jdbc type 1 drivers...

          • 2. Re: New local tx wrapper in 3.1 head
            hezekiel

            Just switched from 2.4.3 to 3RC1... Not a very smooth transition ;-)
            I'm getting these associateConnection not supported exceptions when a bean is loaded for the first time. Subsequent loadings seem to work ok. The exception occurs when the ejbStore method is called by the container.
            BTW I'm using BMP not CMP and yes *I*always*release*the*connection* after the query is executed. If the release connection statement is left out the exceptions occur all the time. Tried with mysql driver 2.0.12 on local computer and with postgreSQL driver 7.2 on remote computer.

            • 3. Re: New local tx wrapper in 3.1 head
              davidjencks

              The new local wrapper wraps only jdbc 1 drivers. If you have an xadatasource, wrap it with the xa wrapper, and if you have a jca adapter, you don't need any wrapper.

              If you are getting associate connection not supported errors, please switch to the new wrapper. At the moment you need to check jboss HEAD out of cvs and build at least the connector module. I should have this in jboss 3 rc2 if you want to wait a few days.

              • 4. Re: New local tx wrapper in 3.1 head
                keithcsl

                Hi

                I just did a CVS today (april 28). Running on postgresql, I still get this exception:

                java.lang.reflect.UndeclaredThrowableException: javax.resource.ResourceException: associateConnection not supported
                at org.jboss.resource.adapter.jdbc.BaseManagedConnection.associateConnection(BaseManagedConnection.java:91)
                at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnect(BaseConnectionManager2.java:487)
                at org.jboss.resource.connectionmanager.CachedConnectionManager.reconnect(CachedConnectionManager.java:332)
                at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:156)
                at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:180)
                at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
                at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)

                I read from your previous post that this is fixed in the latest CVS. Any pointers?

                Keith

                • 5. Re: New local tx wrapper in 3.1 head
                  davidjencks

                  I haven't switched the configs over except for hsqldb. Change the appropriate line to this:
                  <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper

                  • 6. Re: New local tx wrapper in 3.1 head
                    hezekiel

                    Just built the latest source from cvs. So far so good - no more associateConnection errors. Yippee!

                    • 7. Re: New local tx wrapper in 3.1 head
                      keithcsl

                      I have updated the postgres-service.xml as advised.

                      No more errors. However, I am getting a warning:

                      Something about "... you are not getting the right semantics!"

                      I am not at my development PC at the moment, but I will post the exact message soon.

                      Keith

                      • 8. Re: New local tx wrapper in 3.1 head
                        davidjencks

                        This usually means the tx manager is committing a transaction that it thinks has 2 or more participants, so it is using xa prepare and commit. The local wrapper, and Postgres as far as I know, don't support xa. If something goes wrong during commit your databases will be left in an inconsistent state and automatic recovery is not possible.

                        The most likely reason for this is that you are using transacted jms through the jmsra with a local-wrapped db.

                        The only open source free db I know of that supports xa is firebird through the jca-jdbc driver (NOT interclient).

                        • 9. Re: New local tx wrapper in 3.1 head
                          keithcsl

                          I believe I know what happening.

                          I need a second datasource which is non-transactional, but I have declared it as transactional in the postgres-service.

                          How to I define a non-transactional datasource?

                          • 10. Re: New local tx wrapper in 3.1 head
                            davidjencks

                            use the NoTxConnectionManager instead of LocalTxConnectionManager (just change the code attribute in the first mbean, and remove the txmanager attribute). Its like the others except it doesn't have a txmanager attribute. With the new local wrapper you should be able to get autocommit behavior automatically without changing anything. Please let me know if there are any problems with this.

                            • 11. Re: New local tx wrapper in 3.1 head
                              davidjencks

                              vad pointed out a problem with the NoTxConnectionManager in another thread nearby, you will want to try one of the suggested patches. I will try to get to fixing this in cvs soon.

                              • 12. Re: New local tx wrapper in 3.1 head
                                oravecz

                                The XA Wrapper still has the associateConnection() error.

                                • 13. Re: New local tx wrapper in 3.1 head
                                  davidjencks

                                  I know :-((

                                  I hope I have time to replace it before 3.0 final.