<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sembrando Realidades &#187; General</title>
	<atom:link href="http://blog.bauna.com.ar/index.php/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bauna.com.ar</link>
	<description>Un viaje a inciertos destinos</description>
	<lastBuildDate>Fri, 28 May 2010 18:30:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Drools Flow configuration using Spring</title>
		<link>http://blog.bauna.com.ar/index.php/2010/05/drools-flow-configuration-using-spring/</link>
		<comments>http://blog.bauna.com.ar/index.php/2010/05/drools-flow-configuration-using-spring/#comments</comments>
		<pubDate>Fri, 28 May 2010 15:46:34 +0000</pubDate>
		<dc:creator>bauna</dc:creator>
				<category><![CDATA[Drools]]></category>
		<category><![CDATA[Flow]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[PlugTree]]></category>
		<category><![CDATA[software libre]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[PlugTree Drools Flow]]></category>

		<guid isPermaLink="false">http://blog.bauna.com.ar/?p=116</guid>
		<description><![CDATA[There are a lot of Drools Flow users that ask us about how to use Drools Flow persistence without JTA transactions, so in order to give those users a proper answer we developed a solution based on the Spring integration. We added support to configure a JpaSessionServiceFactory to the Drools’ configuration namespace. Let’s see how [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of Drools Flow users that ask us about how to use Drools Flow persistence without JTA transactions, so in order to give those users a proper answer we developed a solution based on the <a title="Drools Spring Integration" href="http://blog.athico.com/2009/12/drools-spring-improvements.html" target="_blank">Spring integration</a>. We added support to configure a JpaSessionServiceFactory to the Drools’ configuration namespace. Let’s see how to use it on a real example (you can donwload it from:<a title="Drools Flow Spring Example" href="http://www.plugtree.com/downloads/DroolsFlowSpring.tgz"> http://www.plugtree.com/downloads/DroolsFlowSpring.tgz</a>).<br />
Firstly, you need to configure EntityManageFactory and SpringTransactionManager as follows:</p>
<pre class="brush: xml; ">

&lt;bean id=&quot;myEmf&quot; class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot;&gt;
&lt;property name=&quot;dataSource&quot; ref=&quot;ds&quot; /&gt;
&lt;property name=&quot;persistenceUnitName&quot; value=&quot;org.drools.persistence.jpa.local&quot; /&gt;
&lt;/bean&gt;

&lt;bean id=&quot;txManager&quot; class=&quot;org.springframework.orm.jpa.JpaTransactionManager&quot;&gt;
&lt;property name=&quot;entityManagerFactory&quot; ref=&quot;myEmf&quot; /&gt;
&lt;/bean&gt;
</pre>
<p>I’m not showing the datasource configuration because it heavily depends on your deployment but you can grab it from the example <img src='http://blog.bauna.com.ar/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<p>Secondly, you have to define a kbase that then would be used by the JpaSessionService:</p>
<pre class="brush: xml; ">

&lt;drools:kbase id=&quot;kbase1&quot;&gt;
&lt;drools:resource type=&quot;DRF&quot; source=&quot;classpath:VariablePersistenceStrategyProcess.rf&quot; /&gt;
&lt;/drools:kbase&gt;
</pre>
<p>And finally, you need to define the JpaSessionService:</p>
<pre class="brush: xml; ">

&lt;drools:jpaSessionServiceFactory id=&quot;jpaSingleSessionCommandService&quot; kbase=&quot;kbase1&quot;
entityManagerFactory=&quot;myEmf&quot; transactionManager=&quot;txManager&quot;&gt;
&lt;drools:variablePersisters&gt;
&lt;drools:persister forClass=&quot;javax.persistence.Entity&quot; implementation=&quot;org.drools.persistence.processinstance.persisters.JPAVariablePersister&quot;/&gt;
&lt;drools:persister forClass=&quot;java.lang.String&quot; implementation=&quot;org.plugtree.labs.variablepersistence.StringVariablePersister&quot;/&gt;
&lt;drools:persister forClass=&quot;java.io.Serializable&quot; implementation=&quot;org.drools.persistence.processinstance.persisters.SerializableVariablePersister&quot;/&gt;
&lt;/drools:variablePersisters&gt;
&lt;/drools:jpaSessionServiceFactory&gt;
</pre>
<p>Bear in mind if that you don&#8217;t need to define customs variable persisters the configuration it&#8217;s only one line!.</p>
<p>Then you can inject it to your own beans or create a Spring Context manually, as shown in the this snippet:</p>
<pre class="brush: java; ">

ctx = new ClassPathXmlApplicationContext(&quot;beans.xml&quot;);
JPASingleSessionCommandService jpaService = (JPASingleSessionCommandService) ctx
.getBean(&quot;jpaSingleSessionCommandService&quot;);
SingleSessionCommandService service = jpaService.newStatefulKnowledgeSession();
int sessionId = service.getSessionId();
....
//do something
service.dispose();

Then in a future time retrieve the session:
SingleSessionCommandService service = jpaService.loadStatefulKnowledgeSession(sessionId);
//do something
....
service.dispose();
</pre>
<p>Warning note: when you use the flow persistence with JTA, it automatically reloads the state out the session after a rollback. We couldn&#8217;t do that behavior here since simple database connections doesn&#8217;t provide a listener mechanism as JTA transactions does.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bauna.com.ar/index.php/2010/05/drools-flow-configuration-using-spring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>No le veo la utilidad a git-svn</title>
		<link>http://blog.bauna.com.ar/index.php/2010/02/no-le-veo-la-utilidad-a-git-svn/</link>
		<comments>http://blog.bauna.com.ar/index.php/2010/02/no-le-veo-la-utilidad-a-git-svn/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 21:28:46 +0000</pubDate>
		<dc:creator>bauna</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.bauna.com.ar/?p=88</guid>
		<description><![CDATA[Ya que estoy trabando con un pequeño grupo de desarrolladores mejorando Drools me dieron ganas de probar git y ver si lo podíamos usar internamente para no tener que crear branchs en el repositorio central. Entonces como todo el mundo hace me puse a leer la man page de git-svn y ahí nomás me bajaron [...]]]></description>
			<content:encoded><![CDATA[<p>Ya que estoy trabando con un pequeño grupo de desarrolladores mejorando <a title="Drools" href="http://www.jboss.org/drools/" target="_blank">Drools</a> me dieron ganas de probar <em>git</em> y ver si lo podíamos usar internamente para no tener que crear branchs en el repositorio central.</p>
<p>Entonces como todo el mundo hace me puse a leer la man page de <a title="git-svn" href="http://www.kernel.org/pub/software/scm/git-core/docs/git-svn.html" target="_blank">git-svn</a> y ahí nomás me bajaron las expectativas de un plumazo en la session &#8220;caveats&#8221; dice:</p>
<blockquote><p>&#8230;</p>
<p>For the sake of simplicity and interoperating with a less-capable system (SVN), it is recommended that all <em>git svn</em> users clone, fetch  and dcommit directly from the SVN server, and avoid all <em>git clone</em>/<em>pull</em>/<em>merge</em>/<em>push</em> operations between git repositories and branches.  The recommended method of exchanging code between git branches and users is <em>git format-patch</em> and <em>git am</em>, or just &#8216;dcommit&#8217;ing to  the SVN repository.</p>
<p>&#8230;</p>
<div>
<p>You <em>must</em> therefore ensure that the most  recent commit of the branch you want to dcommit to is the <em>first</em> parent of the merge.  Chaos  will ensue otherwise, especially if the first parent is an older commit on the same SVN branch.</p>
</div>
<div>
<p><em>git clone</em> does not clone branches under  the refs/remotes/ hierarchy or any <em>git svn</em> metadata, or config.  So repositories created and  managed with using <em>git svn</em> should use <em>rsync</em> for cloning, if cloning  is to be done at all.</p>
</div>
</blockquote>
<p>Lo que en español significa que sólo podes usar <em>git-svn</em> si no utilizas ninguno de los features interesantes en <em>git</em>, no podés clonar de mi copia y la mejor forma de compartir cambios es comiteando directo al repo svn&#8230; En conclusión para aprender una nueva parva de comandos me quedo svn.</p>
<p>Igualmente todavía tengo la esperanza que aparezca alguien que me diga el man page esta siendo muy alarmista y que todo es más sencillo.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bauna.com.ar/index.php/2010/02/no-le-veo-la-utilidad-a-git-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

