<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV>Hi Mauricio,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I don't actually have a stack trace. Every time I've run the test, it has completed without errors exactly once.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>There is nothing in the stack indicating anything bad happened, but immediately after SQL Server is unresponsive to any clients.<BR></DIV>
<DIV>As to Hibernate Mappings, you are ahead of me already.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>I am currently testing with annotated JPA entities (for Claims and Role) which mirror my real Hibernate mapped entities.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I've haven't found anything absolute on this, but think you CAN'T use Hibernate mappings within JPA.</DIV>
<DIV>&nbsp;</DIV>
<DIV>That means we will need a new Variable Persister, but presumably one similar to the JPA Persister.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I'll be testing more today, as I'll can and let you know if my DBA can get any more info to see if SQL Server is telling us anything useful.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks!&nbsp; And great work on the variable persister, the timing was perfect for us!</DIV>
<DIV>&nbsp;</DIV>
<DIV>Bill</DIV>
<DIV>&nbsp;</DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Mauricio Salatino &lt;salaboy@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Rules Users List &lt;rules-users@lists.jboss.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Fri, October 16, 2009 4:41:46 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [rules-users] [droolsflow] JPAVariablePersister Crashing SQL Server RPC?<BR></FONT><BR>HI Bill,<BR>Can you paste here the full stack trace?<BR>I don't test it in SQL Server, but if the problem persist I'm interested in solve it.<BR>Some thoughts:<BR>1) does JPA take the Hibernate Mappings as JPA entities without adding them at the persistence.xml file?, I think yes, but I'm not sure<BR>2) if not, probably we need to create a new persister for hibernate mapped entities.<BR><BR><BR>
<DIV class=gmail_quote>On Thu, Oct 15, 2009 at 9:26 PM, Bill Tarr <SPAN dir=ltr>&lt;<A href="mailto:javatestcase@yahoo.com" rel=nofollow target=_blank ymailto="mailto:javatestcase@yahoo.com">javatestcase@yahoo.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class=gmail_quote>Has anyone successfully used JPAVariablePersister on Sql Server?&nbsp; The quick hits are we are running MSSQL 2008, and after introducing JPAVariablePersister (which is described very well&nbsp;in http://blog.athico.com/2009/09/drools-flow-variable-persistence.html) every time I run my test case, the DB becomes non-responsive, returning from any JDBC pings:<BR><BR>&nbsp;&nbsp;&nbsp; java.sql.SQLException: I/O Error: DB server closed connection.<BR><BR>You can't even connect through MSSQL Management Studios, looks like RPC service has gone down.&nbsp; Haven't been able to do much troubleshooting yet (slow going when you need to get a DBA to reboot your sever every time.)<BR><BR>I've already tested out the JPAKnowledgeService with some success.&nbsp; Setting up my session with the following code,&nbsp; I can see&nbsp;the SessionInfo,
 ProcessInstanceInfo, ProcessInstanceInfo_eventTypes tables storing data, looks pretty solid, and I can grab the processes again.<BR><BR>&nbsp;&nbsp;&nbsp; EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");<BR>&nbsp;&nbsp;&nbsp; env = KnowledgeBaseFactory.newEnvironment();<BR>&nbsp;&nbsp;&nbsp; env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);<BR>&nbsp;&nbsp;&nbsp; session = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env);<BR><BR>&nbsp;&nbsp;&nbsp; Map&lt;String, Object&gt; parameterMap =&nbsp;new HashMap&lt;String, Object&gt;();<BR>&nbsp;&nbsp;&nbsp; parameterMap.put("claim", claim);<BR>&nbsp;&nbsp;&nbsp; processInstance = session.startProcess(CLAIMS_DEMO, parameterMap);<BR><BR>I want to store my variable separately though, as we already have them as Hibernate DTOs.&nbsp; So I added the following code, as well as adding JPAVariablePersister to my
 persistence.xml.<BR><BR>&nbsp;&nbsp;&nbsp; VariablePersistenceStrategyFactory.getVariablePersistenceStrategy()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .setPersister("javax.persistence.Entity",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "org.drools.persistence.processinstance.persisters.JPAVariablePersister");<BR><BR>The code appears to run through.&nbsp; This time, I can see data in&nbsp;&nbsp;the SessionInfo, ProcessInstanceInfo, ProcessInstanceInfo_eventTypes tables, as well as additional data in VariableInstanceInfo, and my two entities (Claim, which has&nbsp;a List of Role.)&nbsp; The data looks pretty good, and my process logs hit the expected&nbsp;nodes.<BR>&nbsp;<BR>Anyway, I'll post more as I learn it.&nbsp; Let me know if anyone else is running into
 this.<BR>&nbsp;<BR>Thanks!<BR>&nbsp;<BR>Bill<BR><BR><BR><BR><BR>_______________________________________________<BR>rules-users mailing list<BR><A href="mailto:rules-users@lists.jboss.org" rel=nofollow target=_blank ymailto="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A><BR><A href="https://lists.jboss.org/mailman/listinfo/rules-users" rel=nofollow target=_blank>https://lists.jboss.org/mailman/listinfo/rules-users</A><BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>- http://salaboy.wordpress.com<BR>- http://www.jbug.com.ar<BR>- Salatino "Salaboy" Mauricio -<BR></DIV></DIV></div><br>

      </body></html>