Thought inc.

The Dynamic O/R Mapping Company
     

CocoBase Technical Support Forums
For access to developer site with software download and doc's, please request CocoBase download and password
will be emailed to you. Response to posts will appear when answered by THOUGHT Support team.
NOTE:You must register separately with forum in order to post your questions, please click on register icon below.
Home   Frequently Asked Questions   Search   Edit your profile   Registration is free!  
Email This Page to Someone!
Show a Printable Version
CocoBase Enterprise O/R Forums > CocoBase Questions
Error: You cannot commit during a managed transaction!
< Previous Thread     Next Thread >
Author
Thread    Post New Thread     Post A Reply
ferstring
Member

Registered: Oct 2006
Posts: 1

Hi,
I had the following error during a select in a MDB (EJB):

04 Out 2006 13:50:03 - com.XYZ - Database error: problem committing transaction.
thought.CocoBase.CBFacadeException: Cannot commit changes; session invalidated
error code: INVALIDSTATE_ERROR
detail message: thought.CocoBase.CocoBaseException: CBMessage=Commit failed in Database SQL.CoreMessage=You cannot commit during a managed transaction! CocoBaseErrorCode=DBCOMMIT_FAILURE
at thought.CocoBase.CBFacadeLocal.commit(CBFacadeLocal.java:527)
at com.XYZ.closeTransaction(SynDao.java:75)
at com.XYZ.SynQuery.run(SynQuery.java:326)
at com.XYZ.SynQuery.run(SynQuery.java:232)

Am I doing something wrong? Or I should only change some configuration properties?

Thank you,
Fernanda

10-04-2006 11:29 AM
Click Here to See the Profile for ferstring    Find more posts by ferstring        Edit/Delete Message    Reply w/Quote    IP: Logged
admin
Administrator

Registered: Apr 2001
Posts: 19

If you are running a CBFacade instance in a j2ee container, you need to use the cbfacade property of:

cocosource.inj2eecontainer=true

So your connection properties for the CBFacade would include:

props.put("cocosource.inj2eecontainer","true");

Does that make sense?

THOUGHT Support

11-14-2006 12:25 PM
Click Here to See the Profile for admin    Find more posts by admin        Edit/Delete Message    Reply w/Quote    IP: Logged
ferstring
Member

Registered: Oct 2006
Posts: 1
Problem with EJB+DataSource in JBoss

Yes, I am using this parameter:
cocosource.inj2eecontainer=true

I think the use of this parameter resolved the problem.

Nowadays We have other kind of problem in an application with EJBs:

We have a 4 MDBs that may work in parallel.
When we send many data to the process and they begin to work in parallel, with DataSource in JBoss, a load operation doesn?t find the data that exists and Cocobase doesn?t show any error.
When we don?t use DataSource, the problem doesn?t occur.

We are using the version 4.5 (SP 8).
We doesn?t use CMPs or BMPs. We use a Utility Jar (in EAR) that are shared with other 2 Projects (EJB Project, Web Project) which are modules from the same EAR. The Utility Project has business classes that invokes database operations.
The Web Project starts the connection pool by a servlet.

What are we doing wrong?

Thank you,

Fernanda

01-16-2007 11:25 AM
Click Here to See the Profile for ferstring    Find more posts by ferstring        Edit/Delete Message    Reply w/Quote    IP: Logged
admin
Administrator

Registered: Apr 2001
Posts: 19
Problem with EJB+DataSource in JBoss

When the cocosource.inj2eecontainer=true is set, this means that we rely on the container to implement all transaction commit operations. If your container doesn't commit the values, then a second connection wouldn't see them until the commit operation occurs.

Typically in EJBs (Session or Entity), the default is a single call from the client defines a transaction boundary. Your xml descriptor defines this. If you are deploying an ear file, but aren't using either a session or entity bean - then you should obtain a UserTransaction object and explicitly define your begin() and commit() boundaries using that transaction object.

What the cocosource.inj2eecontainer property informs CocoBase of, is some layer other than CocoBase is in charge of transaction boundaries. If your application server isn't explicitly creating those boundaries for you (through entity or session beans), you would need to manually do so.

Does that give you more guidance?

THOUGHT Support

01-16-2007 12:25 PM
Click Here to See the Profile for admin    Find more posts by admin        Edit/Delete Message    Reply w/Quote    IP: Logged
All times are PST (US)    Post New Thread     Post A Reply
Forum Jump:
< Previous Thread     Next Thread >

Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author. Messages can be deleted by their author.
Posts: HTML code is OFF. Smilies are OFF. vB code is OFF. [IMG] code is OFF.

Admin Options:
Open / Close Thread
Move Thread
Delete Thread
Edit Thread

< Contact Us - THOUGHT Inc. >

Copyright © Jelsoft Enterprises Limited 2000.
Copyright 2001 All Rights Reserved, THOUGHT Inc.