<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>Hi;<br><br>Actually one-phase commit optimization is required for the Transaction Managers. <br><br>See JCA 1.6 --&gt; Section 7.6.3.3<br><br>--Gurkan<br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Reza Rahman &lt;reza_rahman@lycos.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> Weld-Dev &lt;weld-dev@lists.jboss.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Tue, November 24, 2009 8:47:32 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [weld-dev] persistence and transactions outside Java EE<br></font><br>Emmanuel,<br><br> From what I understand, this is an
 optimization that almost all sane <br>JTA providers have but it is not standards defined behavior. Also, I <br>think a sane JTA transaction manager could work with a non-XA resource <br>in optimized/local mode (again something I think could be defined at the <br>spec level but isn't).<br><br>I'm looking into some of these issues myself vis-a-vis Resin's <br>transaction manager and am thinking this could be a valuable blog topic <br>to help clear the air on some of this...<br><br>Cheers,<br>Reza<br><br><br>Emmanuel Bernard wrote:<br>&gt; Transaction Managers do not engage in distributed transactions if <br>&gt; there is a single resource and that happens automatically.<br>&gt; JTA != 2PC.<br>&gt; Jonathan, correct me if I'm wrong, but I'm sure that's something you <br>&gt; guys have had in the product virtually for ever.<br>&gt;<br>&gt; On 24 nov. 09, at 18:18, Arbi Sookazian wrote:<br>&gt;<br>&gt;&gt; This is a good idea from a corporate developer's
 perspective <br>&gt;&gt; anyways.&nbsp; JEE platform needs to keep things as simple as possible <br>&gt;&gt; (esp. in terms of configuration) for the typical JEE dev. <br>&gt;&gt;<br>&gt;&gt; "Promotable transactions optimize distributed transactions by <br>&gt;&gt; deferring the creation of a distributed transaction until it is <br>&gt;&gt; needed. If only one resource manager is required, no distributed <br>&gt;&gt; transaction occurs."<br>&gt;&gt;<br>&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;<br>&gt;&gt; Instead of focusing on how "apparently" bad the Spring stack is, I <br>&gt;&gt; would recommend focusing on expanding on the good ideas that .NET <br>&gt;&gt; platform has (like the late addition of MVC frmwk in ASP.NET <br>&gt;&gt; &lt;<a href="http://ASP.NET"
 target="_blank">http://ASP.NET</a>&gt;!)<br>&gt;&gt;<br>&gt;&gt; Corporate devs are looking to design and code use cases <br>&gt;&gt; easily/quickly and not worry too much about system level issues, <br>&gt;&gt; clustering and lack of tooling, etc.&nbsp; An integrated solution like <br>&gt;&gt; .NET with the .NET Visual Studio IDE is very attractive (although <br>&gt;&gt; somewhat limiting perhaps b/c the APIs/frmwks are "locked" down).<br>&gt;&gt;<br>&gt;&gt; We have to make way too many decisions about what frmwks and <br>&gt;&gt; libraries to use in JEE (this problem seems to always be getting <br>&gt;&gt; worse as the years go by unfortunately).<br>&gt;&gt;<br>&gt;&gt; On Tue, Nov 24, 2009 at 9:03 AM, Reza Rahman &lt;<a ymailto="mailto:reza_rahman@lycos.com" href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a> <br>&gt;&gt; &lt;mailto:<a ymailto="mailto:reza_rahman@lycos.com"
 href="mailto:reza_rahman@lycos.com">reza_rahman@lycos.com</a>&gt;&gt; wrote:<br>&gt;&gt;<br>&gt;&gt;&nbsp; &nbsp;  Dan,<br>&gt;&gt;<br>&gt;&gt;&nbsp; &nbsp;  Personally, I think the most elegant solution in terms of Java EE is<br>&gt;&gt;&nbsp; &nbsp;  simply to standardize "promotable" transactions. Specifically,<br>&gt;&gt;&nbsp; &nbsp;  JTA could<br>&gt;&gt;&nbsp; &nbsp;  be modified to use local transactions by default and only promote<br>&gt;&gt;&nbsp; &nbsp;  transactions to distributed mode as the need arises. The<br>&gt;&gt;&nbsp; &nbsp;  Microsoft guys<br>&gt;&gt;&nbsp; &nbsp;  have had promotable transactions for ages, I am not sure why we don't<br>&gt;&gt;&nbsp; &nbsp;  have it in Java EE too. This would make the "lightweight" vs<br>&gt;&gt;&nbsp; &nbsp;  "heavyweight" debate moot and keep things simple/consistent from a<br>&gt;&gt;&nbsp; &nbsp;  developer's perspective while most of the systems-level issues<br>&gt;&gt;&nbsp; &nbsp;  are
 dealt<br>&gt;&gt;&nbsp; &nbsp;  by the container where these things belong instead of a steady<br>&gt;&gt;&nbsp; &nbsp;  leak as a<br>&gt;&gt;&nbsp; &nbsp;  development concern.<br>&gt;&gt;<br>&gt;&gt;&nbsp; &nbsp;  Cheers,<br>&gt;&gt;&nbsp; &nbsp;  Reza<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;&nbsp; &nbsp;  Dan Allen wrote:<br>&gt;&gt;&nbsp; &nbsp;  &gt; I was talking to someone about this topic post-Devoxx. I came<br>&gt;&gt;&nbsp; &nbsp;  up with<br>&gt;&gt;&nbsp; &nbsp;  &gt; an idea that may be worth considering. Perhaps the Java EE platform<br>&gt;&gt;&nbsp; &nbsp;  &gt; can recognize another class of bean that has persistence and<br>&gt;&gt;&nbsp; &nbsp;  &gt; transaction capabilities, but not the rest of EJB. Here's my<br>&gt;&gt;&nbsp; &nbsp;  proposed<br>&gt;&gt;&nbsp; &nbsp;  &gt; breakdown, in terms of airplane seat classes (I was on an<br>&gt;&gt;&nbsp; &nbsp;  airplane at<br>&gt;&gt;&nbsp; &nbsp;  &gt; the time).<br>&gt;&gt;&nbsp; &nbsp; 
 &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; First class - EJB session bean<br>&gt;&gt;&nbsp; &nbsp;  &gt; Business class - local transactional bean<br>&gt;&gt;&nbsp; &nbsp;  &gt; Coach - Simple managed bean<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; The main differientiator of a "business class bean" from an EJB is<br>&gt;&gt;&nbsp; &nbsp;  &gt; that it would have the option to use local transactions, just<br>&gt;&gt;&nbsp; &nbsp;  like an<br>&gt;&gt;&nbsp; &nbsp;  &gt; application-managed JPA persistence unit. It would also not support<br>&gt;&gt;&nbsp; &nbsp;  &gt; any HA concerns. But it would be a drop in replacement for<br>&gt;&gt;&nbsp; &nbsp;  so-called<br>&gt;&gt;&nbsp; &nbsp;  &gt; "lightweight" transaction beans that Spring offers.<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; Then, we wouldn't need to do anything special in Weld / Seam 3.<br>&gt;&gt;&nbsp; &nbsp;  All we<br>&gt;&gt;&nbsp; &nbsp;  &gt; would need is
 to be able to support these types of beans in a<br>&gt;&gt;&nbsp; &nbsp;  servlet<br>&gt;&gt;&nbsp; &nbsp;  &gt; container, the same way that Weld supports those environments.<br>&gt;&gt;&nbsp; &nbsp;  But it<br>&gt;&gt;&nbsp; &nbsp;  &gt; would be a standard part of Java EE (6 MR1 or 7).<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; If we feel like we need to support this use case in Seam, then<br>&gt;&gt;&nbsp; &nbsp;  clearly<br>&gt;&gt;&nbsp; &nbsp;  &gt; there is still something missing in Java EE.<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; -Dan<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; On Wed, Nov 18, 2009 at 6:10 PM, Gavin King<br>&gt;&gt;&nbsp; &nbsp;  &lt;<a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;<br>&gt;&gt;&nbsp;
 &nbsp;  &gt; &lt;mailto:<a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;&gt;&gt; wrote:<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  I think we should try and follow the Java EE models as<br>&gt;&gt;&nbsp; &nbsp;  closely as<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  possible for this stuff. We should simply try and make the<br>&gt;&gt;&nbsp; &nbsp;  Java EE<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  code work outside EE 6.<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  e.g.<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  (1) use a resource declaration with<br>&gt;&gt;&nbsp; &nbsp;  @PersistenceContext(unitName=....)<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  to define a managed persistence
 context<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  (2) use JBoss Transactions to manage transactions in a<br>&gt;&gt;&nbsp; &nbsp;  servlet engine<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  - so instead of having a special tx manager for JDBC, it is<br>&gt;&gt;&nbsp; &nbsp;  just JTA<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  Or is the 10meg download for JBoss Transactions just no good?<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  --<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  Gavin King<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  <a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a> &lt;mailto:<a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;<br>&gt;&gt;&nbsp; &nbsp;  &lt;mailto:<a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>
 &lt;mailto:<a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a>&gt;&gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  <a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  <a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  <a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  _______________________________________________<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  weld-dev mailing list<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  <a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a ymailto="mailto:weld-dev@lists.jboss.org"
 href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>&gt;&gt;&nbsp; &nbsp;  &lt;mailto:<a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;&gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;&nbsp; &nbsp;  <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; --<br>&gt;&gt;&nbsp; &nbsp;  &gt; Dan Allen<br>&gt;&gt;&nbsp; &nbsp;  &gt; Senior Software Engineer, Red Hat | Author of Seam in Action<br>&gt;&gt;&nbsp; &nbsp;  &gt; Registered Linux User #231597<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; <a
 href="http://mojavelinux.com" target="_blank">http://mojavelinux.com</a><br>&gt;&gt;&nbsp; &nbsp;  &gt; <a href="http://mojavelinux.com/seaminaction" target="_blank">http://mojavelinux.com/seaminaction</a><br>&gt;&gt;&nbsp; &nbsp;  &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;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  ------------------------------------------------------------------------<br>&gt;&gt;&nbsp; &nbsp;  &gt;<br>&gt;&gt;&nbsp; &nbsp;  &gt; _______________________________________________<br>&gt;&gt;&nbsp; &nbsp;  &gt; weld-dev mailing list<br>&gt;&gt;&nbsp; &nbsp;  &gt; <a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>&gt;&gt;&nbsp; &nbsp;  &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>&gt;&gt;&nbsp; &nbsp;  _______________________________________________<br>&gt;&gt;&nbsp; &nbsp;  weld-dev mailing list<br>&gt;&gt;&nbsp; &nbsp;  <a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>&gt;&gt;&nbsp; &nbsp;  <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>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; weld-dev mailing list<br>&gt;&gt; <a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &lt;mailto:<a
 ymailto="mailto:weld-dev@lists.jboss.org" 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;<br>&gt; _______________________________________________<br>&gt; weld-dev mailing list<br>&gt; <a ymailto="mailto:weld-dev@lists.jboss.org" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br><br>_______________________________________________<br>weld-dev mailing list<br><a ymailto="mailto:weld-dev@lists.jboss.org" 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>
<!-- cg17.c1.mail.mud.yahoo.com compressed/chunked Tue Nov 17 21:32:47 PST 2009 -->
</div><br>

      </body></html>