<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Allan Saddi's projects blog - Java</title>
    <link>http://www.saddi.com/software/news/</link>
    <description>Announcements and ramblings about projects new and old.</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.4 - http://www.s9y.org/</generator>
    <pubDate>Thu, 14 Jun 2007 11:36:11 GMT</pubDate>

    <image>
        <url>http://www.saddi.com/software/news/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Allan Saddi's projects blog - Java - Announcements and ramblings about projects new and old.</title>
        <link>http://www.saddi.com/software/news/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>TranQL Connector for PostgreSQL</title>
    <link>http://www.saddi.com/software/news/archives/56-TranQL-Connector-for-PostgreSQL.html</link>
            <category>Java</category>
    
    <comments>http://www.saddi.com/software/news/archives/56-TranQL-Connector-for-PostgreSQL.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=56</wfw:comment>

    <slash:comments>5</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=56</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    As far as Java development goes, for personal projects and for work, I find myself in that odd place between needing &lt;em&gt;only&lt;/em&gt; a servlet container (e.g. Tomcat) and needing a full JEE container. I&#039;m sure this situation is quite common. The one thing that I almost always end up needing beyond plain servlets is JTA. As I&#039;ve &lt;a href=&quot;http://www.saddi.com/software/news/archives/35-On-Containers....html&quot;&gt;mentioned&lt;/a&gt; in the past, I&#039;ve tried various solutions from plugging in JOTM, which I&#039;m not at all too happy with, to using stripped-down versions of full application servers.&lt;br /&gt;
&lt;br /&gt;
Well, the problem for me is still unresolved, but I did try out &lt;a href=&quot;http://jencks.org/&quot;&gt;Jencks&lt;/a&gt; over the weekend. It was fairly easy to set up, and it worked as expected. (Just have to remember to set the connection manager&#039;s transaction type to XA to actually get XA transactions!) And rather than using DataSourceMCF, one would probably want to use a real MCF for your database for XA functionality.&lt;br /&gt;
&lt;br /&gt;
Which brings me to the point of this post. In the past I&#039;ve blogged about problems with PostgreSQL/XA/TranQL (&lt;a href=&quot;http://www.saddi.com/software/news/archives/36-Adventures-in-JTA.html&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.saddi.com/software/news/archives/37-Continuing-adventures-in....html&quot;&gt;here&lt;/a&gt;). Although the problem was &lt;a href=&quot;http://archives.postgresql.org/pgsql-jdbc/2006-10/msg00043.php&quot;&gt;resolved&lt;/a&gt; in the driver long ago, I don&#039;t believe I ever published the actual PostgreSQL TranQL connector I made. (And believe me, I would rather fold it back into the original project... but I&#039;m having a hard time finding contact information... or a working mailing list... anything.)&lt;br /&gt;
&lt;br /&gt;
Anyway, the connectors: &lt;a href=&quot;http://maven.saddi.com/org/tranql/&quot;&gt;http://maven.saddi.com/org/tranql/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve tested it with Jencks and Geronimo. (And by &quot;test&quot;, I mean I just verified that the PostgreSQL driver is indeed using 2PC.) The source can still be found in the same place: &lt;a href=&quot;http://www.saddi.com/software/tranql/&quot;&gt;http://www.saddi.com/software/tranql/&lt;/a&gt;. You&#039;ll probably need to use the latest 8.2 JDBC driver (which includes the above-mentioned fix).&lt;br /&gt;
&lt;br /&gt;
Hopefully anyone searching for TranQL/PostgreSQL will eventually stumble upon it. I mean, I can&#039;t be the only person interested in using XA transactions with PostgreSQL in Geronimo, right??? &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Mon, 11 Jun 2007 09:39:28 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/56-guid.html</guid>
    
</item>
<item>
    <title>Tapestry: A return to the familiar?</title>
    <link>http://www.saddi.com/software/news/archives/38-Tapestry-A-return-to-the-familiar.html</link>
            <category>Java</category>
    
    <comments>http://www.saddi.com/software/news/archives/38-Tapestry-A-return-to-the-familiar.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=38</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=38</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    I often heard about the &lt;a href=&quot;http://tapestry.apache.org/&quot;&gt;Tapestry&lt;/a&gt; framework in passing, but I never really paid heed to it. It wasn&#039;t until I read a minor blurb about it in Rod Johnson&#039;s &lt;em&gt;J2EE Development without EJB&lt;/em&gt; that my interest was finally piqued. Basically, it stated that Tapestry was inspired by the WebObjects&#039; Page/Component model, something I am somewhat familiar with. Something I look back at with a certain nostalgia.&lt;br /&gt;
&lt;br /&gt;
WebObjects was my first experience with a &quot;real&quot; web application framework. Before then, I was working with CGIs and my own cobbled-together Python modules. After proving to myself that I could indeed run it on my collocated FreeBSD server (an unsupported platform by WebObjects... not to mention by Java as well, back then), I started dabbling in Enterprise Objects/WebObjects. Eventually, I wrote a number of applications, though mostly internal.&lt;br /&gt;
&lt;br /&gt;
It also gave me a chance to brush up/re-learn Java. Though WebObjects was heavily tied to the OpenStep way of doing things, just under Java (i.e. the collections were not standard Java Collections, among other things), which I didn&#039;t really like.&lt;br /&gt;
&lt;br /&gt;
Anyhow, I moved on from WebObjects, preferring to do my Java web development with &quot;frameworks&quot; like Hibernate and Spring. But WebObjects had some neat ideas, and anything WO-inspired will always catch my attention. (For example, in Python world, there&#039;s the &lt;a href=&quot;http://modeling.sourceforge.net/&quot;&gt;Modeling&lt;/a&gt; framework, which looks promising.)&lt;br /&gt;
&lt;br /&gt;
Anyway, no where in the Tapestry site will you actually see the word WebObjects, which is probably why I glanced over it before. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; But having played with Tapestry now, I see the influence. And not only that, with annotations and automatic state management, Tapestry has taken the Page/Component model to another level. (And the upcoming Tapestry 5 looks even more exciting.)&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;But&lt;/em&gt;, the thing that made WebObjects development bearable was WOBuilder, the graphical, WYSIWIG page/component editor. I haven&#039;t looked at the IDE plugins for Tapestry yet, but that level of integration seems to be missing. (Editing a page/component involved editing 3 files &amp;mdash; the class, the spec, and the html template. WOBuilder actually edited all 3 in a relatively sane manner.)&lt;br /&gt;
&lt;br /&gt;
I&#039;ll probably play with Tapestry a bit more, and I&#039;ve already built a template web applications for myself. Whether or not there&#039;s a decent Tapestry plugin for Eclipse will probably decide whether I&#039;ll base any future projects on it. Though you can omit the spec file using annotations in the Java class, editing the template files by hand seems a bit daunting. In fact, it reminds me, not so fondly, of my homebrew Python templating engine, HTMLpp. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Though Tapestry 5 templates seem a lot easier to write... 
    </content:encoded>

    <pubDate>Wed, 08 Nov 2006 09:00:15 -0800</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/38-guid.html</guid>
    
</item>
<item>
    <title>Continuing adventures in...</title>
    <link>http://www.saddi.com/software/news/archives/37-Continuing-adventures-in....html</link>
            <category>Java</category>
    
    <comments>http://www.saddi.com/software/news/archives/37-Continuing-adventures-in....html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=37</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=37</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    After reading the JTA/J2EE Connector specs, I&#039;ve decided the problem is indeed in the PostgreSQL JDBC driver. It sets autocommit to false and assumes it remains false indefinitely. tranql is (correctly) re-enabling autocommit in its ManagedConnection.cleanup method.&lt;br /&gt;
&lt;br /&gt;
So I patched up PGXAConnection so its autocommit handling is a bit more sane... i.e. it&#039;s on by default and is only turned off within XA transactions. Outside of XA transactions, it&#039;s re-enabled.&lt;br /&gt;
&lt;br /&gt;
Anyway, quite an educational experience... I now know a little more about JTA/XA/resource connectors. More than I really wanted to, actually. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ll have to clean up my patch (and re-do it against HEAD), but it&#039;s available &lt;a href=&quot;http://www.saddi.com/software/tranql/&quot;&gt;here&lt;/a&gt; along with a re-compiled jar.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a bug/email &lt;a href=&quot;http://archives.postgresql.org/pgsql-jdbc/2006-05/msg00104.php&quot;&gt;about the problem&lt;/a&gt; brought up a few months ago. I don&#039;t think anything was ever done.&lt;br /&gt;
&lt;br /&gt;
Now hopefully I can move on to actually writing apps... &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Sat, 07 Oct 2006 08:52:11 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/37-guid.html</guid>
    
</item>
<item>
    <title>Adventures in JTA</title>
    <link>http://www.saddi.com/software/news/archives/36-Adventures-in-JTA.html</link>
            <category>Java</category>
    
    <comments>http://www.saddi.com/software/news/archives/36-Adventures-in-JTA.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=36</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=36</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    I decided to (temporarily) convert my skeleton webapp to use JTA. Being Spring-based, it was a simple matter of editing the application context config... or so I thought. Apparently, for distributed transaction support, it has to be supported by not only the application and container, but also the connector and database driver.&lt;br /&gt;
&lt;br /&gt;
Doing some research, I found out I needed an XA compliant connector... which are apparently vendor-specific. I searched &lt;a href=&quot;http://tranql.codehaus.org/&quot;&gt;tranql&#039;s site&lt;/a&gt; and surprisingly, there is no PostgreSQL support. &quot;Why is this?&quot; I asked and the answer (through Googling) turned out to be because PostgreSQL itself doesn&#039;t have XA Resource support... let alone two phase commit.&lt;br /&gt;
&lt;br /&gt;
Or so I thought. All the various blogs/articles stating the fact were apparently out of date. PostgreSQL has had 2PC support &lt;a href=&quot;http://archives.postgresql.org/pgsql-committers/2005-06/msg00220.php&quot;&gt;for over a year&lt;/a&gt;. And the JDBC driver has also supported XA &lt;a href=&quot;http://jdbc.postgresql.org/documentation/faq.html#xa&quot;&gt;for some time&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
So great... I just needed a PostgreSQL-specific tranql connector. (Again, very odd that one doesn&#039;t already exist.) After a minor struggle searching for tranql&#039;s source (note that the CVS info at their site is outdated... I used Codehaus&#039; &lt;a href=&quot;http://fisheye.codehaus.org/browse/tranql&quot;&gt;FishEye repository browser&lt;/a&gt; instead), I managed to see what was involved in creating a vendor-specific connector.&lt;br /&gt;
&lt;br /&gt;
Very little, it seemed. So using the Derby connector as a starting point, I went ahead and created PostgreSQL tranql connectors, in both local and XA flavors. It was so utterly simple, I don&#039;t know why it wasn&#039;t done before. (And I&#039;ve googled around...) I don&#039;t know if I should even bother contributing it back? It was literally a matter of changing a few package/class names and deleting some unused setters/getters...&lt;br /&gt;
&lt;br /&gt;
Anyhow, the tranql connectors for PostgreSQL can be found &lt;a href=&quot;http://www.saddi.com/software/tranql/&quot;&gt;here&lt;/a&gt; for now. You&#039;ll need to use a PostgreSQL JDBC driver that supports XA (like 8.1-407).&lt;br /&gt;
&lt;br /&gt;
As far as I know, it works (but that doesn&#039;t really say much). Someday I&#039;ll have to create a simple app that uses two or more datasources and play around with it more.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Edit:&lt;/b&gt; Maybe I spoke too soon. For whatever reason, rollbacks are still committing. The XA connector looks to be written ok, and after enabling debug logging, I see rollback being called on the XAResource... so maybe it&#039;s a driver problem?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Edit2:&lt;/b&gt; Found it. Looks like tranql commits by calling setAutoCommit(true). The connection then becomes stuck with autoCommit on. (Which is odd, since beginning a transaction sets it to false... maybe the Geronimo transaction manager doesn&#039;t normally do a begin?) I fixed it by patching the PostgreSQL driver, namely the XAConnection implementation. Seemed the cleanest approach for now. Will have to investigate the begin issue another time... 
    </content:encoded>

    <pubDate>Fri, 06 Oct 2006 12:57:29 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/36-guid.html</guid>
    
</item>
<item>
    <title>On Containers...</title>
    <link>http://www.saddi.com/software/news/archives/35-On-Containers....html</link>
            <category>Java</category>
    
    <comments>http://www.saddi.com/software/news/archives/35-On-Containers....html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=35</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=35</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    All this time, I&#039;ve been running my Java web applications on plain Tomcat... with a few jars thrown in. And I&#039;ve been pretty happy. The only J2EE (or JEE?) thing I needed that Tomcat didn&#039;t provide out of the box was JavaMail support. (I&#039;m trying to stay away from EJBs...)&lt;br /&gt;
&lt;br /&gt;
Then I started thinking... it would be pretty nice to be able to update two or more databases in some future app I write. (For example, a global &quot;user&quot; database and an app-specific database.) So logically, of course, this brought me to JTA. I searched for free JTA implementations and found &lt;a href=&quot;http://jotm.objectweb.org/&quot;&gt;JOTM&lt;/a&gt;, which seemed to meet my needs well. It even had documentation on how to integrate it with Tomcat. But unfortunately, the docs were quite outdated and I had no luck.&lt;br /&gt;
&lt;br /&gt;
I was about to give up when I stumbled upon &lt;a href=&quot;http://www.nabble.com/UserTransaction,-JOTM-and-Tomcat-5.5.x-t1073172.html&quot;&gt;this&lt;/a&gt; and subsequently &lt;a href=&quot;http://static.raibledesigns.com/downloads/howto-tomcat-jotm.html&quot;&gt;this&lt;/a&gt;. It was exactly what I needed... documentation on integrating JOTM with Tomcat 5.5.x running on Java 5. Aside from a minor shutdown problem (i.e. it didn&#039;t), it seemed to work nicely.&lt;br /&gt;
&lt;br /&gt;
But the fact I had to cobble it together made me wary. (Not to mention JOTM hasn&#039;t been updated for a while and the mailing list seems a bit... dead.) So I started thinking along the lines of... what if I took a full J2EE container and stripped it down?&lt;br /&gt;
&lt;br /&gt;
So for the last week or so, I&#039;ve been playing with various (free) J2EE containers. I&#039;ve tried out &lt;a href=&quot;http://geronimo.apache.org/&quot;&gt;Geronimo&lt;/a&gt;, &lt;a href=&quot;http://jonas.objectweb.org/&quot;&gt;JOnAS&lt;/a&gt;, &lt;a href=&quot;http://jboss.com/products/jbossas&quot;&gt;JBoss AS&lt;/a&gt;. (This is hardly an exhaustive list, of course.) J2EE containers, I&#039;ve learned, are rather large, almost-unwieldly beasts. Sure, my new server has 2GB of RAM, but I didn&#039;t want most of that to be taken up by an appserver. Anyhow, for technical, ideological, and ease-of-use reasons, I decided to go ahead with Geronimo.&lt;br /&gt;
&lt;br /&gt;
Geronimo comes in two flavors: a full J2EE-certified container and a minimal installation (&quot;Little-G&quot;). After some playing around, it turns out what I needed was actually something in between. First I tried starting with the full thing and shutting down services I didn&#039;t need. It worked pretty well... aside from the fact that I needed axis-deployer to be running to successfully deploy war files. (Despite having turned off axis itself...)&lt;br /&gt;
&lt;br /&gt;
So I tried the other way: started with Little-G and copied things from the full version. And that, it seems, is the better approach. (It gets around the axis-deployer problem by having a stub called unavailable-webservices-deployer... imagine that! &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;) Anyhow, for future reference, what I ended up copying to Little-G was:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;repository/tranql/tranql-connector&lt;/li&gt;&lt;li&gt;repository/geronimo/geronimo-mail&lt;/li&gt;&lt;li&gt;repository/geronimo/geronimo-javamail-transport&lt;/li&gt;&lt;li&gt;repository/geronimo/javamail&lt;/li&gt;&lt;/ul&gt;And I also threw in the hot-deployer module and jar file because it&#039;s such a convenient way to deploy apps. The tranql module is needed to be able to deploy DB connection pools (odd that it isn&#039;t included in Little-G, huh?) and the rest are for JavaMail support.&lt;br /&gt;
&lt;br /&gt;
Anyway, I moved all but one app to this new set up. (The holdout is &lt;a href=&quot;http://rollerweblogger.org/&quot;&gt;Roller&lt;/a&gt;... no matter what I did, it just wouldn&#039;t work. Not insurmountable, but seemingly just some annoying classloader problem I have to work out...)&lt;br /&gt;
&lt;br /&gt;
Anyhow, after going through all that, I feel a bit compelled to write something that requires JTA now... &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Fri, 22 Sep 2006 12:09:34 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/35-guid.html</guid>
    
</item>
<item>
    <title>Java implementation of Advogato's trust metric</title>
    <link>http://www.saddi.com/software/news/archives/33-Java-implementation-of-Advogatos-trust-metric.html</link>
            <category>Java</category>
    
    <comments>http://www.saddi.com/software/news/archives/33-Java-implementation-of-Advogatos-trust-metric.html#comments</comments>
    <wfw:comment>http://www.saddi.com/software/news/wfwcomment.php?cid=33</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.saddi.com/software/news/rss.php?version=2.0&amp;type=comments&amp;cid=33</wfw:commentRss>
    

    <author>nospam@example.com (Allan Saddi)</author>
    <content:encoded>
    I thought I&#039;d go ahead and release my &lt;a href=&quot;ftp://ftp.saddi.com/pub/software/advogato-tmetric-asaddi-0.1.tar.gz&quot;&gt;Java implementation&lt;/a&gt; of &lt;a href=&quot;http://advogato.org/trust-metric.html&quot;&gt;Advogato&#039;s trust metric&lt;/a&gt;. I thought it was a relatively clean (IMHO) interface-based design and I just wanted to share. &lt;img src=&quot;http://www.saddi.com/software/news/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Note that I haven&#039;t actually used it anywhere though. (I plan to use it in Flup, the website.) And the unit tests are laughable. But as far as I can tell, it works as expected. (The flow network and actual trust metric code are based off old Python implementations...)&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Fri, 02 Jun 2006 16:22:27 -0700</pubDate>
    <guid isPermaLink="false">http://www.saddi.com/software/news/archives/33-guid.html</guid>
    
</item>

</channel>
</rss>