Bug 1036761 - It is not possible to restore a ksession on Oracle11gR2 due to RuntimeException: Unable to begin transaction
Summary: It is not possible to restore a ksession on Oracle11gR2 due to RuntimeExcepti...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER 7
: 6.0.0
Assignee: Maciej Swiderski
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-02 15:13 UTC by Ivo Bek
Modified: 2014-08-06 20:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Oracle11gR2 jbpm 6 - redhat-6 dependencies
Last Closed: 2014-08-06 20:11:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
stacktrace (40.04 KB, text/plain)
2013-12-02 15:13 UTC, Ivo Bek
no flags Details
the process definition where I restore a ksession (11.20 KB, application/xml)
2013-12-02 15:18 UTC, Ivo Bek
no flags Details

Description Ivo Bek 2013-12-02 15:13:03 UTC
Created attachment 831629 [details]
stacktrace

Description of problem:

First, see the attached process definition. After I complete the first task1, I restore the singleton ksession. The restore means:

disposeRuntimeManager();
createRuntimeManager(processDefinitions);
return getRuntimeEngine().getKieSession();

As it tries to restore runtimemanager "manager = managerFactory.newSingletonRuntimeManager(environment);", I get this exception: RuntimeException: Unable to begin transaction -- details are in the attached stacktrace

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Configure persistence.xml to use Oracle11gR2 database
2. Setup datasource and session persistence (for that you can use JbpmJUnitBaseTestCase)
3. Run the attached process definition via java api (Also I'll add a link to the source code)
4. See the output - compare with the attached stacktrace

Actual results:


Expected results:


Additional info:

Comment 2 Ivo Bek 2013-12-02 15:18:15 UTC
Created attachment 831630 [details]
the process definition where I restore a ksession

Comment 3 Maciej Swiderski 2013-12-12 13:19:46 UTC
Ivo, I believe that main problem here is that you dispose ksession directly without using RuntimeManager.disposeRuntimeEngine which is for exactly that purpose. If you manually dispose ksession then all other components like timer service and others might still be active and will cause the unexpected issues.

Please ensure that you always use RuntimeManager and RuntimeEngine to dispose underlying resources.

When it comes to the exceptions with bitronix, it looks like bitronix is closed before application components such as RuntimeManager/RuntimeEngine and thus failing on accessing the transaction log that is actually a file.

Could you please double check your tests and apply above suggestions to check if that is still the case?

Comment 4 Edson Tirelli 2013-12-12 13:47:33 UTC
Proposing the blocker flag as agreed in the triage meeting, but please check if this is really an issue and fix or close as non issue, accordingly.

Comment 8 Maciej Swiderski 2013-12-16 16:53:39 UTC
it was caused by canceling timer that was in progress and by that owned transaction log channel. By canceling, thread pool send interput signal to the thread and by that channel used for transaction log was directly closed. Thread pool factory was added to timer to ensure it won't interrupt the transaction log. 

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/f67a81b8cf8b7e29c6f3ef39fd5d10498496cbfe

6.0.x:
https://github.com/droolsjbpm/jbpm/commit/8d223329a5143e35276f8931efa6ae0618bd8173

Comment 9 Ivo Bek 2014-01-07 16:45:42 UTC
Verified in BPMS 6.0.0.ER7


Note You need to log in before you can comment on or make changes to this bug.