<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I don&#8217;t understand what you meant by
storing the HttpServletRequest object? With the default marshalling strategy
for JPA in place I don&#8217;t think you can insert a non serializable object? &nbsp;How
come this piece of code is working fine at your end?<o:p></o:p></span></font></p>

<p class=MsoNormal><b><font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS";font-weight:bold'>loadSession.insert(request);</span></font></b><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Which set of objects are you looking from
the request? May be you want to get hold of the request parameter map &nbsp;-- or
create a list of&nbsp; attribute map and insert those instead of HttpServletRequest
object<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Am I missing something of what you meant
in your email?<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
Pardeep.Ruhil@lntinfotech.com [mailto:Pardeep.Ruhil@lntinfotech.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, November 18, 2009
10:15 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Vijay K Pandey;
rules-users@lists.jboss.org<br>
<b><span style='font-weight:bold'>Cc:</span></b> kris.verlaenen@cs.kuleuven.be<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [rules-users] Drools
Flow :Persistence Problem : Restore StatefulKnowledgeSession from database</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
</span></font><font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;
font-family:"Trebuchet MS"'>Hi Vijay,</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>Thanks for your reply.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>The problem is that object that I am inserting it into the
session object is NOT serializable, as you know HttpServletRequest object is
not serializable.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>So because of this I am not able to store this object into the
database.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>So that's why I am asking how can i do this if my object is not
serilizable.</span></font> <br>
<br>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'>Thanks &amp; Regards<br>
<br>
Pardeep Ruhil<br>
nt (s) If you are not the intended recipient, please do not use or disseminate
the information, notify the sender and delete it from your system. </span></font><br>
<br>
<o:p></o:p></p>

<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
 style='width:100.0%'>
 <tr>
  <td width="40%" valign=top style='width:40.0%;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><font size=1 face="Trebuchet MS"><span
  style='font-size:7.5pt;font-family:"Trebuchet MS";font-weight:bold'>Vijay K
  Pandey &lt;VPandey@mdes.ms.gov&gt;</span></font></b><font size=1
  face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>
  </span></font><o:p></o:p></p>
  <p><font size=1 face="Trebuchet MS"><span style='font-size:7.5pt;font-family:
  "Trebuchet MS"'>11/18/2009 10:56 PM</span></font> <o:p></o:p></p>
  </td>
  <td width="59%" valign=top style='width:59.0%;padding:.75pt .75pt .75pt .75pt'>
  <table class=MsoNormalTable border=0 cellpadding=0 width="100%"
   style='width:100.0%'>
   <tr>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal align=right style='text-align:right'><font size=1
    face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>To</span></font><o:p></o:p></p>
    </td>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
    7.5pt;font-family:"Trebuchet MS"'>&quot;Pardeep.Ruhil@lntinfotech.com&quot;
    &lt;Pardeep.Ruhil@lntinfotech.com&gt;,
    &quot;rules-users@lists.jboss.org&quot; &lt;rules-users@lists.jboss.org&gt;</span></font>
    <o:p></o:p></p>
    </td>
   </tr>
   <tr>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal align=right style='text-align:right'><font size=1
    face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>cc</span></font><o:p></o:p></p>
    </td>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
    7.5pt;font-family:"Trebuchet MS"'>&quot;kris.verlaenen@cs.kuleuven.be&quot;
    &lt;kris.verlaenen@cs.kuleuven.be&gt;</span></font> <o:p></o:p></p>
    </td>
   </tr>
   <tr>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal align=right style='text-align:right'><font size=1
    face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>Subject</span></font><o:p></o:p></p>
    </td>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
    7.5pt;font-family:"Trebuchet MS"'>RE: [rules-users] Drools Flow
    :Persistence Problem : Restore StatefulKnowledgeSession from database</span></font><o:p></o:p></p>
    </td>
   </tr>
  </table>
  <p class=MsoNormal><font size=3 face="Times New Roman"><span
  style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>
  <table class=MsoNormalTable border=0 cellpadding=0>
   <tr>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=3 face="Times New Roman"><span
    style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>
    </td>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=3 face="Times New Roman"><span
    style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>
    </td>
   </tr>
  </table>
  <p class=MsoNormal><font size=3 face="Times New Roman"><span
  style='font-size:12.0pt'><o:p></o:p></span></font></p>
  </td>
 </tr>
</table>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<br>
</span></font><font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'>You have to load the same &#8216;<b><span
style='font-weight:bold'>StatefulKnowledgeSession</span></b>&#8217; in which you have
inserted your objects</span></font><font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'>. </span></font><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>The inserted objects are serialized and stored in the column &#8220;<b><span
style='font-weight:bold'>rules_byte_array</span></b>&#8221; of the <b><span
style='font-weight:bold'>session_info</span></b> table. </span></font><br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>&nbsp;</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>So you have to load the same session &#8211; to get to your
inserted objects. </span></font><br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>&nbsp;</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>There is a difference the way process map objects are handled
&#8211; such as</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>&nbsp;</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;
&nbsp; &nbsp; &nbsp; Map&lt;String, Object&gt; parameters = <b><font
color="#820040"><span style='color:#820040;font-weight:bold'>new</span></font></b>
HashMap&lt;String, Object&gt;();</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;
&nbsp; &nbsp; &nbsp; parameters.put(<font color="#4200ff"><span
style='color:#4200FF'>&quot;x&quot;</span></font>, <font color="#4200ff"><span
style='color:#4200FF'>&quot;hello&quot;</span></font>);</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;
&nbsp; &nbsp; &nbsp; parameters.put(<font color="#4200ff"><span
style='color:#4200FF'>&quot;y&quot;</span></font>, <font color="#4200ff"><span
style='color:#4200FF'>&quot;hey I am y&quot;</span></font>);</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;
&nbsp; &nbsp; &nbsp; ksession.startProcess( <font color="#4200ff"><span
style='color:#4200FF'>&quot;myprocess&quot;</span></font>, parameters );</span></font>
<br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>&nbsp;</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>In the above case the parameters are not stored as part of
the &#8220;session info&#8221; table. These are stored separately like in &#8220;process instance
info&#8221; table + (some/other tables if you use variable persistence strategy)&#8211; so
if you don&#8217;t have the rules which are based on the objects you are inserting &#8211;
you can get the same done through process parameters in which case you can get
hold of the process instance through &nbsp;any new session or the same session
and then its parameters.</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>&nbsp;</span></font> <br>
<font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Vijay</span></font> <o:p></o:p></p>

<p class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center>

</span></font></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
</span></font><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
Pardeep.Ruhil@lntinfotech.com [mailto:Pardeep.Ruhil@lntinfotech.com] <b><span
style='font-weight:bold'><br>
Sent:</span></b> Wednesday, November 18, 2009 12:38 AM<b><span
style='font-weight:bold'><br>
To:</span></b> rules-users@lists.jboss.org<b><span style='font-weight:bold'><br>
Cc:</span></b> kris.verlaenen@cs.kuleuven.be; Vijay K Pandey<b><span
style='font-weight:bold'><br>
Subject:</span></b> Re: [rules-users] Drools Flow :Persistence Problem :
Restore StatefulKnowledgeSession from database</span></font> <br>
&nbsp; <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Hi Kris,</span></font> <font size=2 face="Trebuchet MS"><span style='font-size:
10.0pt;font-family:"Trebuchet MS"'><br>
Thanks for you valuable input and Vijay of course clearing some of my doubts by
asking question on this.</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Much of my doubt are clear except one. <br>
When we are reloading the StatefulKnowledgeSession from the database using the
below line</span></font> <font size=2 face="Courier New"><span
style='font-size:10.0pt;font-family:"Courier New"'><br>
</span></font>&nbsp;<font size=2 face="Courier New"><span style='font-size:
10.0pt;font-family:"Courier New"'><br>
StatefulKnowledgeSession loadSession= JPAKnowledgeService.<i><span
style='font-style:italic'>loadStatefulKnowledgeSession</span></i>(id, <i><font
color="#0021bf"><span style='color:#0021BF;font-style:italic'>kbase</span></font></i>,
<b><font color="#820040"><span style='color:#820040;font-weight:bold'>null</span></font></b>,
<i><font color="#0021bf"><span style='color:#0021BF;font-style:italic'>env</span></font></i>);</span></font>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
This session object is different from the one that is created when we first
created <br>
StatefulknowledgeSession object using </span></font><br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:"Courier New"'><br>
StatefulKnowledgeSession <b><span style='font-weight:bold'>initialSession</span></b>=
JPAKnowledgeService.<i><span style='font-style:italic'>newStatefulKnowledgeSession</span></i>(<i><font
color="#0021bf"><span style='color:#0021BF;font-style:italic'>kbase</span></font></i>,
<b><font color="#820040"><span style='color:#820040;font-weight:bold'>null</span></font></b>,
<i><font color="#0021bf"><span style='color:#0021BF;font-style:italic'>env</span></font></i>);</span></font>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Am I right ?</span></font> <br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Now In my case I have a <b><span style='font-weight:bold'>HumanWorkItemHandler</span></b>
class for handling the <b><span style='font-weight:bold'>humantask</span></b>
and there is<b><span style='font-weight:bold'> ActionWorkITemHandle</span></b>r
for my customAction workItem, which both are initailsed with the <b><span
style='font-weight:bold'>initialSession </span></b>object.</span></font> <font
size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:"Trebuchet MS"'><br>
Now when I load the session from the database to complete the
HumanWorkItemHandler task I got a different session object i.e. <b><span
style='font-weight:bold'>loadSession. </span></b><br>
Now when I insert something in the loadsession using &nbsp;<b><span
style='font-weight:bold'>loadSession.insert(request);</span></b> So that I can
use the same in ActionWorkItemHandler to exceute the action for the request. <br>
I am not able to retrieve the same request object i.e. (HttpServletRequest)
from the session in ActionWorkItemHandler <br>
as when i do <br>
&nbsp; &nbsp; &nbsp; &nbsp;Collection obj = loadSession.getObject();</span></font>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
I get request as <b><span style='font-weight:bold'>null. &nbsp;</span></b>
Because this loadSession is different from the one I have inserted.</span></font>
<br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Kindly help in this, or I have misunderstood the concept. </span></font><br>
<font size=2 face="Trebuchet MS"><span style='font-size:10.0pt;font-family:
"Trebuchet MS"'><br>
Thanks &amp; Regards<br>
<br>
Pardeep Ruhil</span></font><o:p></o:p></p>

<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
 style='width:100.0%'>
 <tr>
  <td width="33%" valign=top style='width:33.0%;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><font size=1 face="Trebuchet MS"><span
  style='font-size:7.5pt;font-family:"Trebuchet MS";font-weight:bold'>Kris
  Verlaenen &lt;kris.verlaenen@cs.kuleuven.be&gt;</span></font></b><font
  size=1 face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>
  </span></font><o:p></o:p></p>
  <p><font size=1 face="Trebuchet MS"><span style='font-size:7.5pt;font-family:
  "Trebuchet MS"'>11/17/2009 04:17 PM</span></font> <o:p></o:p></p>
  </td>
  <td width="66%" valign=top style='width:66.0%;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><font size=3 face="Times New Roman"><span
  style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>
  <table class=MsoNormalTable border=0 cellpadding=0 width="100%"
   style='width:100.0%'>
   <tr>
    <td width="6%" valign=top style='width:6.0%;padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal align=right style='text-align:right'><font size=1
    face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>To</span></font><o:p></o:p></p>
    </td>
    <td width="93%" valign=top style='width:93.0%;padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
    7.5pt;font-family:"Trebuchet MS"'>Rules Users List &lt;rules-users@lists.jboss.org&gt;,
    Vijay K Pandey &lt;VPandey@mdes.ms.gov&gt;</span></font> <o:p></o:p></p>
    </td>
   </tr>
   <tr>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal align=right style='text-align:right'><font size=1
    face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>cc</span></font><o:p></o:p></p>
    </td>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
    7.5pt;font-family:"Trebuchet MS"'>&quot;Pardeep.Ruhil@lntinfotech.com&quot;
    &lt;Pardeep.Ruhil@lntinfotech.com&gt;</span></font> <o:p></o:p></p>
    </td>
   </tr>
   <tr>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal align=right style='text-align:right'><font size=1
    face="Trebuchet MS"><span style='font-size:7.5pt;font-family:"Trebuchet MS"'>Subject</span></font><o:p></o:p></p>
    </td>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=1 face="Trebuchet MS"><span style='font-size:
    7.5pt;font-family:"Trebuchet MS"'>Re: [rules-users] Drools Flow
    :Persistence Problem : Restore StatefulKnowledgeSession from database</span></font><o:p></o:p></p>
    </td>
   </tr>
  </table>
  <p class=MsoNormal><font size=3 face="Times New Roman"><span
  style='font-size:12.0pt'><br>
  &nbsp; <o:p></o:p></span></font></p>
  <p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>
  <table class=MsoNormalTable border=0 cellpadding=0>
   <tr>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=3 face="Times New Roman"><span
    style='font-size:12.0pt'>&nbsp; <o:p></o:p></span></font></p>
    </td>
    <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
    <p class=MsoNormal><font size=3 face="Times New Roman"><span
    style='font-size:12.0pt'>&nbsp;<o:p></o:p></span></font></p>
    </td>
   </tr>
  </table>
  <p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><o:p></o:p></span></font></p>
  </td>
 </tr>
</table>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
<br>
</span></font><font size=2 face="Courier New"><span style='font-size:10.0pt;
font-family:"Courier New"'><br>
Preferably you should cache the session itself as well (so you don't<br>
have to recreate it all the time) and reuse that across you application.<br>
Or you could have multiple independent sessions as well. &nbsp;If you store<br>
the key of the session somewhere, you can easily restore this session<br>
(or sessions) after failure.<br>
<br>
Kris<br>
<br>
Quoting Vijay K Pandey &lt;VPandey@mdes.ms.gov&gt;:<br>
<br>
&gt; Let's say where we don't need timers - in those cases one can create<br>
&gt; (create only if its not there) a global session (create the<br>
&gt; sessioninfo at the drools startup - store the session primary key<br>
&gt; somewhere) - reuse this session across everywhere?<br>
&gt; <br>
&gt; Vijay<br>
&gt; -----Original Message-----<br>
&gt; From: rules-users-bounces@lists.jboss.org<br>
&gt; [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Kris<br>
&gt; Verlaenen<br>
&gt; Sent: Monday, November 16, 2009 5:12 PM<br>
&gt; To: Rules Users List; Pardeep.Ruhil@lntinfotech.com<br>
&gt; Subject: Re: [rules-users] Drools Flow :Persistence Problem : Restore<br>
&gt; StatefulKnowledgeSession from database<br>
&gt; <br>
&gt; Pardeep,<br>
&gt; <br>
&gt; The behavior you are describing is indeed correct. &nbsp;The session in<br>
&gt; this<br>
&gt; case is a global session, meaning that it will be used for all<br>
&gt; process<br>
&gt; instances. &nbsp;Note however that, unless you are using timers, all<br>
&gt; other<br>
&gt; state (process instance state, work items, etc.) is persisted<br>
&gt; separately<br>
&gt; and the session state will basically be empty.<br>
&gt; <br>
&gt; It is also possible to have one session per process instance (or<br>
&gt; whatever partitioning you like). &nbsp;A session has a unique id (which<br>
&gt; you<br>
&gt; can specify when reloading the session). &nbsp;You'll then have to load<br>
&gt; the<br>
&gt; right session before continuing the execution of your process<br>
&gt; instance.<br>
&gt; <br>
&gt; Kris<br>
&gt; <br>
&gt; Quoting Pardeep.Ruhil@lntinfotech.com:<br>
&gt; <br>
&gt; &gt; Hi Salaboy,<br>
&gt; &gt; Thanks for you replying.<br>
&gt; &gt; Yes, of course it is storing multiple process instance Id in the<br>
&gt; &gt; database.<br>
&gt; &gt; But, what I feel is that it will fail when I am trying to run two<br>
&gt; &gt; workflow<br>
&gt; &gt; at the same time simultaneously, using the same code by<br>
&gt; dynamically<br>
&gt; &gt; providing the workflow name and the parameters for each of them.<br>
&gt; &gt; Ideally there should be two entries for the<br>
&gt; StatfulKnowledgeSession<br>
&gt; &gt; object<br>
&gt; &gt; because when I try to load the StatefulKnowledgeSession object<br>
&gt; from<br>
&gt; &gt; the<br>
&gt; &gt; database it will give me the session object of the workflow which<br>
&gt; is<br>
&gt; &gt; last<br>
&gt; &gt; executed.<br>
&gt; &gt;<br>
&gt; &gt; For example lets &nbsp;suppose I have two workflow 1 and 2 having two<br>
&gt; &gt; humantask<br>
&gt; &gt; in each of them . So when I finish the first Human Task of both<br>
&gt; &gt; workflow<br>
&gt; &gt; one by one. &nbsp;SessionInfo &nbsp;present in the database is of
workflow 2<br>
&gt; &gt; (if 2<br>
&gt; &gt; is executed last). Because there is no field in the sessioninfo<br>
&gt; &gt; entity of<br>
&gt; &gt; the database regarding to which workflow it belongs to. Am I right<br>
&gt; ?<br>
&gt; &gt; So when I &nbsp;try to finish the 1st workflow by executing the 2nd<br>
&gt; &gt; humantask<br>
&gt; &gt; left in it , I need to reload the StatfulKnowledgeSession object<br>
&gt; from<br>
&gt; &gt; the<br>
&gt; &gt; database. As there is no way of distinguishing that the session<br>
&gt; &gt; object<br>
&gt; &gt; store in the database is of which workflow , there might be a<br>
&gt; problem<br>
&gt; &gt; as I<br>
&gt; &gt; may get the ksession object of 2nd workflow.<br>
&gt; &gt;<br>
&gt; &gt; In case of Process Instance it is fine , because there is a field<br>
&gt; &gt; 'processId' which will distinguish which processInstanceId belongs<br>
&gt; to<br>
&gt; &gt;<br>
&gt; &gt; which worklowId or processId.<br>
&gt; &gt; But in case of Session , there is noting as such.<br>
&gt; &gt; I don't what I am saying is handled in drools persistence. Please<br>
&gt; let<br>
&gt; &gt; me<br>
&gt; &gt; know if it there or not.<br>
&gt; &gt;<br>
&gt; &gt; Thanks &amp; Regards<br>
&gt; &gt;<br>
&gt; &gt; Pardeep Ruhil<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; ______________________________________________________________________<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; rules-users@lists.jboss.org<br>
&gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; rules-users@lists.jboss.org<br>
&gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>
&gt; <br>
<br>
<br>
<br>
<br>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm<br>
<br>
______________________________________________________________________</span></font><br>
<br>
<br>
______________________________________________________________________ <o:p></o:p></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
______________________________________________________________________ <o:p></o:p></span></font></p>

<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
______________________________________________________________________<o:p></o:p></span></font></p>

</div>

</body>

</html>