We actually have parallel conversations going here. Putting aside the question of JTA overhead, the main concern is that JTA transactions simply aren&#39;t available in a servlet environment (without extra configuration). Hence my idea of having a lightweight transactional bean that makes use of local transactions rather than requiring JTA transactions provided by an EJB (or EJB lite) container.<br>
<br>Or perhaps, it&#39;s all unnecessary and we just tell people to use EJB lite if they want transactions and persistence.<br><br>-Dan<br><br><div class="gmail_quote">On Tue, Nov 24, 2009 at 2:49 PM, Reza Rahman <span dir="ltr">&lt;<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Gurkan,<br>
<br>
Thanks for that...reading through JTA/JCA has been on my wish-list for a<br>
while, I just haven&#39;t gotten around to it yet - the blog post exploring<br>
JTA performance would have been my final impetus :-).<br>
<br>
So the real overhead of JTA in optimized mode is what exactly (as far as<br>
you know)?<br>
<br>
Cheers,<br>
<font color="#888888">Reza<br>
</font><div><div></div><div class="h5"><br>
<br>
Gurkan Erdogdu wrote:<br>
&gt; Hi;<br>
&gt;<br>
&gt; Actually one-phase commit optimization is required for the Transaction<br>
&gt; Managers.<br>
&gt;<br>
&gt; See JCA 1.6 --&gt; Section 7.6.3.3<br>
&gt;<br>
&gt; --Gurkan<br>
&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt; *From:* Reza Rahman &lt;<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a>&gt;<br>
&gt; *To:* Weld-Dev &lt;<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; *Sent:* Tue, November 24, 2009 8:47:32 PM<br>
&gt; *Subject:* Re: [weld-dev] persistence and transactions outside Java EE<br>
&gt;<br>
&gt; Emmanuel,<br>
&gt;<br>
&gt; From what I understand, this is an optimization that almost all sane<br>
&gt; JTA providers have but it is not standards defined behavior. Also, I<br>
&gt; think a sane JTA transaction manager could work with a non-XA resource<br>
&gt; in optimized/local mode (again something I think could be defined at the<br>
&gt; spec level but isn&#39;t).<br>
&gt;<br>
&gt; I&#39;m looking into some of these issues myself vis-a-vis Resin&#39;s<br>
&gt; transaction manager and am thinking this could be a valuable blog topic<br>
&gt; to help clear the air on some of this...<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Reza<br>
&gt;<br>
&gt;<br>
&gt; Emmanuel Bernard wrote:<br>
&gt; &gt; Transaction Managers do not engage in distributed transactions if<br>
&gt; &gt; there is a single resource and that happens automatically.<br>
&gt; &gt; JTA != 2PC.<br>
&gt; &gt; Jonathan, correct me if I&#39;m wrong, but I&#39;m sure that&#39;s something you<br>
&gt; &gt; guys have had in the product virtually for ever.<br>
&gt; &gt;<br>
&gt; &gt; On 24 nov. 09, at 18:18, Arbi Sookazian wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; This is a good idea from a corporate developer&#39;s perspective<br>
&gt; &gt;&gt; anyways.  JEE platform needs to keep things as simple as possible<br>
&gt; &gt;&gt; (esp. in terms of configuration) for the typical JEE dev.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; &quot;Promotable transactions optimize distributed transactions by<br>
&gt; &gt;&gt; deferring the creation of a distributed transaction until it is<br>
&gt; &gt;&gt; needed. If only one resource manager is required, no distributed<br>
&gt; &gt;&gt; transaction occurs.&quot;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; src: <a href="http://msdn.microsoft.com/en-us/library/ms172070%28VS.80%29.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms172070%28VS.80%29.aspx</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Instead of focusing on how &quot;apparently&quot; bad the Spring stack is, I<br>
&gt; &gt;&gt; would recommend focusing on expanding on the good ideas that .NET<br>
&gt; &gt;&gt; platform has (like the late addition of MVC frmwk in <a href="http://ASP.NET" target="_blank">ASP.NET</a><br>
&gt; &gt;&gt; &lt;<a href="http://ASP.NET" target="_blank">http://ASP.NET</a>&gt;!)<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Corporate devs are looking to design and code use cases<br>
&gt; &gt;&gt; easily/quickly and not worry too much about system level issues,<br>
&gt; &gt;&gt; clustering and lack of tooling, etc.  An integrated solution like<br>
&gt; &gt;&gt; .NET with the .NET Visual Studio IDE is very attractive (although<br>
&gt; &gt;&gt; somewhat limiting perhaps b/c the APIs/frmwks are &quot;locked&quot; down).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; We have to make way too many decisions about what frmwks and<br>
&gt; &gt;&gt; libraries to use in JEE (this problem seems to always be getting<br>
&gt; &gt;&gt; worse as the years go by unfortunately).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Tue, Nov 24, 2009 at 9:03 AM, Reza Rahman &lt;<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a><br>
&gt; &lt;mailto:<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a>&gt;<br>
</div></div><div><div></div><div class="h5">&gt; &gt;&gt; &lt;mailto:<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a> &lt;mailto:<a href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a>&gt;&gt;&gt; wrote:<br>

&gt; &gt;&gt;<br>
&gt; &gt;&gt;    Dan,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;    Personally, I think the most elegant solution in terms of Java EE is<br>
&gt; &gt;&gt;    simply to standardize &quot;promotable&quot; transactions. Specifically,<br>
&gt; &gt;&gt;    JTA could<br>
&gt; &gt;&gt;    be modified to use local transactions by default and only promote<br>
&gt; &gt;&gt;    transactions to distributed mode as the need arises. The<br>
&gt; &gt;&gt;    Microsoft guys<br>
&gt; &gt;&gt;    have had promotable transactions for ages, I am not sure why we<br>
&gt; don&#39;t<br>
&gt; &gt;&gt;    have it in Java EE too. This would make the &quot;lightweight&quot; vs<br>
&gt; &gt;&gt;    &quot;heavyweight&quot; debate moot and keep things simple/consistent from a<br>
&gt; &gt;&gt;    developer&#39;s perspective while most of the systems-level issues<br>
&gt; &gt;&gt;    are dealt<br>
&gt; &gt;&gt;    by the container where these things belong instead of a steady<br>
&gt; &gt;&gt;    leak as a<br>
&gt; &gt;&gt;    development concern.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;    Cheers,<br>
&gt; &gt;&gt;    Reza<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;    Dan Allen wrote:<br>
&gt; &gt;&gt;    &gt; I was talking to someone about this topic post-Devoxx. I came<br>
&gt; &gt;&gt;    up with<br>
&gt; &gt;&gt;    &gt; an idea that may be worth considering. Perhaps the Java EE<br>
&gt; platform<br>
&gt; &gt;&gt;    &gt; can recognize another class of bean that has persistence and<br>
&gt; &gt;&gt;    &gt; transaction capabilities, but not the rest of EJB. Here&#39;s my<br>
&gt; &gt;&gt;    proposed<br>
&gt; &gt;&gt;    &gt; breakdown, in terms of airplane seat classes (I was on an<br>
&gt; &gt;&gt;    airplane at<br>
&gt; &gt;&gt;    &gt; the time).<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; First class - EJB session bean<br>
&gt; &gt;&gt;    &gt; Business class - local transactional bean<br>
&gt; &gt;&gt;    &gt; Coach - Simple managed bean<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; The main differientiator of a &quot;business class bean&quot; from an EJB is<br>
&gt; &gt;&gt;    &gt; that it would have the option to use local transactions, just<br>
&gt; &gt;&gt;    like an<br>
&gt; &gt;&gt;    &gt; application-managed JPA persistence unit. It would also not<br>
&gt; support<br>
&gt; &gt;&gt;    &gt; any HA concerns. But it would be a drop in replacement for<br>
&gt; &gt;&gt;    so-called<br>
&gt; &gt;&gt;    &gt; &quot;lightweight&quot; transaction beans that Spring offers.<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; Then, we wouldn&#39;t need to do anything special in Weld / Seam 3.<br>
&gt; &gt;&gt;    All we<br>
&gt; &gt;&gt;    &gt; would need is to be able to support these types of beans in a<br>
&gt; &gt;&gt;    servlet<br>
&gt; &gt;&gt;    &gt; container, the same way that Weld supports those environments.<br>
&gt; &gt;&gt;    But it<br>
&gt; &gt;&gt;    &gt; would be a standard part of Java EE (6 MR1 or 7).<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; If we feel like we need to support this use case in Seam, then<br>
&gt; &gt;&gt;    clearly<br>
&gt; &gt;&gt;    &gt; there is still something missing in Java EE.<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; -Dan<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; On Wed, Nov 18, 2009 at 6:10 PM, Gavin King<br>
&gt; &gt;&gt;    &lt;<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;<br>
&gt; &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;&gt;<br>
&gt; &gt;&gt;    &gt; &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;<br>
&gt; &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;&gt;&gt;&gt; wrote:<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;    I think we should try and follow the Java EE models as<br>
&gt; &gt;&gt;    closely as<br>
&gt; &gt;&gt;    &gt;    possible for this stuff. We should simply try and make the<br>
&gt; &gt;&gt;    Java EE<br>
&gt; &gt;&gt;    &gt;    code work outside EE 6.<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;    e.g.<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;    (1) use a resource declaration with<br>
&gt; &gt;&gt;    @PersistenceContext(unitName=....)<br>
&gt; &gt;&gt;    &gt;    to define a managed persistence context<br>
&gt; &gt;&gt;    &gt;    (2) use JBoss Transactions to manage transactions in a<br>
&gt; &gt;&gt;    servlet engine<br>
&gt; &gt;&gt;    &gt;    - so instead of having a special tx manager for JDBC, it is<br>
&gt; &gt;&gt;    just JTA<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;    Or is the 10meg download for JBoss Transactions just no good?<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;    --<br>
&gt; &gt;&gt;    &gt;    Gavin King<br>
&gt; &gt;&gt;    &gt;    <a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;<br>
&gt; &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;&gt;<br>
&gt; &gt;&gt;    &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;<br>
</div></div><div><div></div><div class="h5">&gt; &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;&gt;&gt;<br>
&gt; &gt;&gt;    &gt;    <a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br>
&gt; &gt;&gt;    &gt;    <a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br>
&gt; &gt;&gt;    &gt;    <a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br>
&gt; &gt;&gt;    &gt;    _______________________________________________<br>
&gt; &gt;&gt;    &gt;    weld-dev mailing list<br>
&gt; &gt;&gt;    &gt;    <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;&gt;<br>
&gt; &gt;&gt;    &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
&gt; &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt; &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
&gt; &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;&gt;&gt;<br>
&gt; &gt;&gt;    &gt;    <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; --<br>
&gt; &gt;&gt;    &gt; Dan Allen<br>
&gt; &gt;&gt;    &gt; Senior Software Engineer, Red Hat | Author of Seam in Action<br>
&gt; &gt;&gt;    &gt; Registered Linux User #231597<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; <a href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br>
&gt; &gt;&gt;    &gt; <a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>
&gt; &gt;&gt;    &gt; <a href="http://www.google.com/profiles/dan.j.allen" target="_blank">http://www.google.com/profiles/dan.j.allen</a><br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt; &gt;&gt;    &gt;<br>
&gt; &gt;&gt;    &gt; _______________________________________________<br>
&gt; &gt;&gt;    &gt; weld-dev mailing list<br>
&gt; &gt;&gt;    &gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;&gt;<br>
&gt; &gt;&gt;    &gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;    _______________________________________________<br>
&gt; &gt;&gt;    weld-dev mailing list<br>
&gt; &gt;&gt;    <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;&gt;<br>
&gt; &gt;&gt;    <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; weld-dev mailing list<br>
&gt; &gt;&gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;&gt;<br>
&gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt; &gt;<br>
</div></div>&gt; &gt; ------------------------------------------------------------------------<br>
<div><div></div><div class="h5">&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; weld-dev mailing list<br>
&gt; &gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; weld-dev mailing list<br>
&gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt;<br>
<br>
_______________________________________________<br>
weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br><a href="http://www.google.com/profiles/dan.j.allen">http://www.google.com/profiles/dan.j.allen</a><br>