[jboss-svn-commits] JBL Code SVN: r28909 - labs/jbossrules/trunk/drools-persistence-jpa/src/main/java/org/drools/persistence/session.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 11 19:41:04 EDT 2009


Author: KrisVerlaenen
Date: 2009-08-11 19:41:04 -0400 (Tue, 11 Aug 2009)
New Revision: 28909

Modified:
   labs/jbossrules/trunk/drools-persistence-jpa/src/main/java/org/drools/persistence/session/SingleSessionCommandService.java
Log:
JBRULES-2199: NullPointerException with JPA session persistence in Drools Flow
 - setting session id after creating session

Modified: labs/jbossrules/trunk/drools-persistence-jpa/src/main/java/org/drools/persistence/session/SingleSessionCommandService.java
===================================================================
--- labs/jbossrules/trunk/drools-persistence-jpa/src/main/java/org/drools/persistence/session/SingleSessionCommandService.java	2009-08-11 21:28:49 UTC (rev 28908)
+++ labs/jbossrules/trunk/drools-persistence-jpa/src/main/java/org/drools/persistence/session/SingleSessionCommandService.java	2009-08-11 23:41:04 UTC (rev 28909)
@@ -131,11 +131,11 @@
         // update the session id to be the same as the session info id
         ((StatefulKnowledgeSessionImpl)ksession).session.setId( this.sessionInfo.getId() );
 
-        new Thread( new Runnable() {
-            public void run() {
-                ksession.fireUntilHalt();
-            }
-        } );
+//        new Thread( new Runnable() {
+//            public void run() {
+//                ksession.fireUntilHalt();
+//            }
+//        } );
     }
 
     public SingleSessionCommandService(int sessionId,
@@ -187,11 +187,14 @@
 		this.kContext = new KnowledgeCommandContext(new ContextImpl( "ksession", null), null, null, this.ksession );
         ((JPASignalManager) ((StatefulKnowledgeSessionImpl)ksession).session.getSignalManager()).setCommandService( this );
 
-        new Thread( new Runnable() {
-            public void run() {
-                ksession.fireUntilHalt();
-            }
-        } );
+        // update the session id to be the same as the session info id
+        ((StatefulKnowledgeSessionImpl)ksession).session.setId( this.sessionInfo.getId() );
+
+//        new Thread( new Runnable() {
+//            public void run() {
+//                ksession.fireUntilHalt();
+//            }
+//        } );
     }
 
     public Context getContext() {
@@ -270,12 +273,12 @@
                 throw new RuntimeException( "Could not execute command",
                                             t1 );
             }
-        } finally {
-            new Thread( new Runnable() {
-                public void run() {
-                    ksession.fireUntilHalt();
-                }
-            } );
+//        } finally {
+//            new Thread( new Runnable() {
+//                public void run() {
+//                    ksession.fireUntilHalt();
+//                }
+//            } );
         }
     }
 



More information about the jboss-svn-commits mailing list