[JBoss jBPM] - cancel timer failed...
by galanfish
hi all, i am learning the lates PVM source code these days.
i've created a timer which will call signal to of the host execution to change the normal flow.
the process is like this:
start --> do some --> schedule(timer)&wait ---> timeout state ---> ...
| |
| + -----------> signal to cancel timer --->....
the problem is that, when i cancel the timer(call TimerSession#cancel(timer)), then exception cames out:
org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [org.jbpm.pvm.internal.job.TimerImpl#26]
i thought that i have to remove the reference of the to-be-removed-timer by the Execution instance first, then i call TimerSession#cancel(timer), but i can not find any API to remove a timer from an execution.
or i should modify the 'cascade' attribute in the hibernate configuration file of the class 'Execution'? but i'm affraid that the modification like this would bring more unknow mistake.
or i am totally wrong?
appreciate!!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213300#4213300
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213300
15 years, 12 months
[JBoss jBPM] - Re: Transaction Issue
by Toriton
After your question.. i changed the DS for a not XA datasource, using as template the examples DS under JBoss/docs/examples/jca.
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!-- ===================================================================== -->
| <!-- -->
| <!-- JBoss Server Configuration -->
| <!-- -->
| <!-- ===================================================================== -->
|
| <!-- $Id: oracle-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
| <!-- ==================================================================== -->
| <!-- Datasource config for Oracle originally from Steven Coy -->
| <!-- ==================================================================== -->
|
|
| <datasources>
| <local-tx-datasource>
| <jndi-name>JbpmDS</jndi-name>
| <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
| <!--
|
| Here are a couple of the possible OCI configurations.
| For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.92...
|
| <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
| or
| <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
|
| Clearly, its better to have TNS set up properly.
| -->
| <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
| <user-name>system</user-name>
| <password>123</password>
| <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
| <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
| <!-- Checks the Oracle error codes and messages for fatal errors -->
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
| <!-- sql to call when connection is created
| <new-connection-sql>some arbitrary sql</new-connection-sql>
| -->
|
| <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
| <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
| -->
|
| <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| </local-tx-datasource>
|
| </datasources>
|
Error log with the same error.
anonymous wrote :
| 2009-02-26 10:30:54,178 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] setCachePolicy, c=org.jboss.util.TimedCachePolicy@10747b4
| 2009-02-26 10:30:54,178 DEBUG [org.jboss.security.plugins.JaasSecurityManagerService] Added jbpm-console, org.jboss.security.plugins.SecurityDomainContext@f47af3 to map
| 2009-02-26 10:30:54,662 DEBUG [org.jbpm.configuration.JbpmContextInfo] creating jbpm context with service factories '[tx, message, scheduler, logging, persistence, authentication]'
| 2009-02-26 10:30:54,662 DEBUG [org.jbpm.JbpmContext] creating org.jbpm.JbpmContext@126d235
| 2009-02-26 10:30:54,662 DEBUG [org.jbpm.persistence.jta.JtaDbPersistenceService] begin user transaction
| 2009-02-26 10:30:54,662 DEBUG [org.jbpm.persistence.db.DbPersistenceService] using current hibernate session
| 2009-02-26 10:30:54,662 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
| 2009-02-26 10:30:54,662 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 5061184121495552
| 2009-02-26 10:30:54,662 ERROR [org.jbpm.db.GraphSession] org.hibernate.HibernateException: getNamedQuery is not valid without active transaction
| 2009-02-26 10:30:54,850 DEBUG [org.jbpm.JbpmContext] closing jbpmContext org.jbpm.JbpmContext@126d235
| 2009-02-26 10:30:54,850 DEBUG [org.jbpm.svc.Services] closing service 'persistence': org.jbpm.persistence.jta.JtaDbPersistenceService@17c76f6
| 2009-02-26 10:30:54,850 DEBUG [org.jbpm.persistence.jta.JtaDbPersistenceService] rolling back user transaction
| 2009-02-26 10:30:54,850 DEBUG [org.jbpm.svc.Services] closing service 'tx': org.jbpm.tx.TxService@663731
| 2009-02-26 10:30:54,850 DEBUG [org.jbpm.svc.Services] closing service 'authentication': org.jbpm.security.authentication.DefaultAuthenticationService@b19f4e
|
And i don't understand this message:
2009-02-26 10:30:54,850 DEBUG [org.jbpm.persistence.jta.JtaDbPersistenceService] rolling back user transaction
If jbpm invoke a roll back on a transaction.. well there is a transaction, that instead is missing when calling named query..
And before the ERROR, seems that session was created successfully..
Where is the damn error.. i'm sure that is something missing in mine configuration...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213269#4213269
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213269
15 years, 12 months