Topic
  • 7 replies
  • Latest Post - ‏2006-09-08T03:48:51Z by SystemAdmin
SystemAdmin
SystemAdmin
37421 Posts

Pinned topic J2CA0081E: Method cleanup...

‏2006-09-07T22:11:41Z |
Hi All,

I have started to see a new error in our application. In this application, we spawn new threads for each MQ message received, and the steps provided below is what we do on each thread. During my research, I found that this may be a thread safe issue. A brief description of what we do in the class that is generating this error:

1. Begin DB transaction
2. Insert/Update to DB
3. If Successful, Commit DB transaction
4. If Failure, Rollback DB transaction
5. Finally clause, whether an error occurs or not, we call a connection cleanup class that should close the connection. (This is the section which throws the following error regardless of previous DB transaction failure or success)

Have anyone seen this issue before, and if so, please advise what could be causing this.

Thanks!

***********************************************************************
4/14/05 1:12:41:325 CDT 189856ab
MCWrapper E J2CA0081E: Method cleanup
failed while trying to execute method cleanup
on ManagedConnection
com.ibm.ws.rsadapter.spi.WSRdbManagedConnection
Impl@6fecd6a7 from resource
jdbc/TMTPDataSource. Caught exception:
com.ibm.ws.exception.WsException: DSRA0080E:
An exception was received by the Data Store
Adapter. See original exception message:
Cannot call 'cleanup' on a ManagedConnection
while it is still in a transaction..
Updated on 2006-09-08T03:48:51Z at 2006-09-08T03:48:51Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    37421 Posts

    Re: J2CA0081E: Method cleanup...

    ‏2006-09-07T22:54:33Z  
    lcarr74@optonline.net wrote:
    > Hi All,
    >
    > I have started to see a new error in our application. In this application, we spawn new threads for each MQ message received, and the steps provided below is what we do on each thread. During my research, I found that this may be a thread safe issue. A brief description of what we do in the class that is generating this error:
    >
    > 1. Begin DB transaction
    > 2. Insert/Update to DB
    > 3. If Successful, Commit DB transaction
    > 4. If Failure, Rollback DB transaction
    > 5. Finally clause, whether an error occurs or not, we call a connection cleanup class that should close the connection. (This is the section which throws the following error regardless of previous DB transaction failure or success)
    >
    > Have anyone seen this issue before, and if so, please advise what could be causing this.

    It's illegal to spawn threads in the EJB container.
  • SystemAdmin
    SystemAdmin
    37421 Posts

    Re: J2CA0081E: Method cleanup...

    ‏2006-09-07T23:05:24Z  
    lcarr74@optonline.net wrote:
    > Hi All,
    >
    > I have started to see a new error in our application. In this application, we spawn new threads for each MQ message received, and the steps provided below is what we do on each thread. During my research, I found that this may be a thread safe issue. A brief description of what we do in the class that is generating this error:
    >
    > 1. Begin DB transaction
    > 2. Insert/Update to DB
    > 3. If Successful, Commit DB transaction
    > 4. If Failure, Rollback DB transaction
    > 5. Finally clause, whether an error occurs or not, we call a connection cleanup class that should close the connection. (This is the section which throws the following error regardless of previous DB transaction failure or success)
    >
    > Have anyone seen this issue before, and if so, please advise what could be causing this.

    It's illegal to spawn threads in the EJB container.
    Thank you, but we are not using anything related to EJBs.
  • SystemAdmin
    SystemAdmin
    37421 Posts

    Re: J2CA0081E: Method cleanup...

    ‏2006-09-08T00:15:33Z  
    Thank you, but we are not using anything related to EJBs.
    lcarr74@optonline.net wrote:
    > Thank you, but we are not using anything related to EJBs.

    This is not an MDB ? Why else would you be getting a J2CA error?
  • SystemAdmin
    SystemAdmin
    37421 Posts

    Re: J2CA0081E: Method cleanup...

    ‏2006-09-08T00:24:59Z  
    lcarr74@optonline.net wrote:
    > Thank you, but we are not using anything related to EJBs.

    This is not an MDB ? Why else would you be getting a J2CA error?
    Paul Ilechko wrote:
    > lcarr74@optonline.net wrote:
    >> Thank you, but we are not using anything related to EJBs.
    >
    > This is not an MDB ? Why else would you be getting a J2CA error?

    Also, this seems to be a known problem ...make sure you have the
    appropriate fixes.

    http://www-1.ibm.com/support/docview.wss?uid=swg1PK16329
  • SystemAdmin
    SystemAdmin
    37421 Posts

    Re: J2CA0081E: Method cleanup...

    ‏2006-09-08T00:47:24Z  
    Paul Ilechko wrote:
    > lcarr74@optonline.net wrote:
    >> Thank you, but we are not using anything related to EJBs.
    >
    > This is not an MDB ? Why else would you be getting a J2CA error?

    Also, this seems to be a known problem ...make sure you have the
    appropriate fixes.

    http://www-1.ibm.com/support/docview.wss?uid=swg1PK16329
    Hmmm, maybe I'm misunderstaning the difference. We are using IBM's MQ to listen to messages. And using a getter/setter class to store needed values. I'm new to Java technology, and have never had the chance to inform myself of what MDBs are. So, if this automatically uses the EJB container, I did not know that. Please confirm.

    Also, we have one other listener doing the same thing, spawning new threads upon receiving messages. The only difference is that the other one does not do any DB manipulations. And this only started happening lately, after about 2 months of never seeing this type of message.

    Thanks for the article. I will take a look at it.
  • SystemAdmin
    SystemAdmin
    37421 Posts

    Re: J2CA0081E: Method cleanup...

    ‏2006-09-08T01:31:10Z  
    Hmmm, maybe I'm misunderstaning the difference. We are using IBM's MQ to listen to messages. And using a getter/setter class to store needed values. I'm new to Java technology, and have never had the chance to inform myself of what MDBs are. So, if this automatically uses the EJB container, I did not know that. Please confirm.

    Also, we have one other listener doing the same thing, spawning new threads upon receiving messages. The only difference is that the other one does not do any DB manipulations. And this only started happening lately, after about 2 months of never seeing this type of message.

    Thanks for the article. I will take a look at it.
    lcarr74@optonline.net wrote:
    > Hmmm, maybe I'm misunderstaning the difference. We are using IBM's
    > MQ to listen to messages. And using a getter/setter class to store
    > needed values. I'm new to Java technology, and have never had the
    > chance to inform myself of what MDBs are. So, if this automatically
    > uses the EJB container, I did not know that. Please confirm.

    Yes, an MDB is a type of EJB.
  • SystemAdmin
    SystemAdmin
    37421 Posts

    Re: J2CA0081E: Method cleanup...

    ‏2006-09-08T03:48:51Z  
    lcarr74@optonline.net wrote:
    > Hmmm, maybe I'm misunderstaning the difference. We are using IBM's
    > MQ to listen to messages. And using a getter/setter class to store
    > needed values. I'm new to Java technology, and have never had the
    > chance to inform myself of what MDBs are. So, if this automatically
    > uses the EJB container, I did not know that. Please confirm.

    Yes, an MDB is a type of EJB.
    A nice intro tutorial ...

    http://www-128.ibm.com/developerworks/rational/library/06/0829_suresh/

    Paul Ilechko wrote:

    > lcarr74@optonline.net wrote:
    >
    >> Hmmm, maybe I'm misunderstaning the difference. We are using IBM's
    >> MQ to listen to messages. And using a getter/setter class to store
    >> needed values. I'm new to Java technology, and have never had the
    >> chance to inform myself of what MDBs are. So, if this automatically
    >> uses the EJB container, I did not know that. Please confirm.
    >
    >
    > Yes, an MDB is a type of EJB.
    Jim Palistrant
    Market Manager, Rational SOA Solutions