[JBoss jBPM] - Re: java.sql.SQLException: You cannot commit during a manage
by trouby
Hey,
Not that I'm very familiar with JBPM's source code but here's the code of createSchema:
| public void createSchema(String jbpmContextName) {
| JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
| try {
| Services services = jbpmContext.getServices();
| DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
| persistenceServiceFactory.createSchema();
| } finally {
| jbpmContext.close();
| }
| }
|
I didn't see any JBPM code that commits the transaction, seems like persistenceServiceFactory.createSchema(); invokes the schema creation via Hibernate's SchemaExport class which probably somewhere perform the commit by itself,
I didn't go to deep but if somone is familiar with it then I'll be glad for a solution,
Otherwise, I'll try to invoke the method over a non-CMT,
Thanks a lot :)
Asaf.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192621#4192621
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192621
15 years, 6 months
[JBoss jBPM] - java.sql.SQLException: You cannot commit during a managed tr
by trouby
Hey,
I have created a very simple seam component that injects the jbpmContext and uses it to create the schema, this is the code:
| @name("workflowManager")
| public class WorkflowManager {
|
| @In
| private JbpmContext jbpmContext;
|
|
| public void createJbpmSchema() {
| jbpmContext.getJbpmConfiguration().createSchema()
| }
| }
|
When invoked, I get the following exception:
| 21:13:32,867 ERROR [SchemaExport] schema export unsuccessful
| java.sql.SQLException: You cannot commit during a managed transaction!
| at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:581)
| at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:482)
| at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:30)
| at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
| at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
| ...
|
I looked at the source code of the createSchema method,
Seems like it's just invoking jbpmContext.close(); at the end.
My JBPM/hibernate configured in the right way not to start/close a transaction it didn't start.
What is the reason of the exception?
Thanks,
Asaf.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192610#4192610
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192610
15 years, 6 months