Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 39815 invoked from network); 19 Oct 2006 02:24:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Oct 2006 02:24:05 -0000 Received: (qmail 87124 invoked by uid 500); 19 Oct 2006 02:24:05 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 87104 invoked by uid 500); 19 Oct 2006 02:24:05 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 87095 invoked by uid 99); 19 Oct 2006 02:24:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Oct 2006 19:24:04 -0700 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of kwsutter@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Oct 2006 19:24:02 -0700 Received: by nf-out-0910.google.com with SMTP id m18so352562nfc for ; Wed, 18 Oct 2006 19:23:41 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=fFt/NsHqbc3pvztbIX+2w/DIfMMnxgL68kyzb+2UhBA1xrdSuEXXX4Dvso/PMVi6CxuYRIufrjhvSrQAGbRH55+B9XeKnRgGbNZtfIAwBCODq1GmvhNgst34+TX/rAgIOmyhPLhFZlkUjvbx/pOBM2v42jAU4sds4lADpmTz9wU= Received: by 10.78.204.20 with SMTP id b20mr10967634hug; Wed, 18 Oct 2006 19:23:40 -0700 (PDT) Received: by 10.78.128.3 with HTTP; Wed, 18 Oct 2006 19:23:40 -0700 (PDT) Message-ID: <89c0c52c0610181923y5ed47c3bx530336482c60aaf2@mail.gmail.com> Date: Wed, 18 Oct 2006 21:23:40 -0500 From: "Kevin Sutter" To: open-jpa-dev@incubator.apache.org Subject: Re: TransactionManagerFactory and WAS (was: [VOTE] publish openjpa 0.9.5-incubating podling release) In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_55970_5560918.1161224620674" References: <38D03C8F-ED25-477B-B92B-5862ACD34493@apache.org> <89c0c52c0610181443r4fbb163ehfc8f00c7c4248072@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_55970_5560918.1161224620674 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/18/06, Craig L Russell wrote: > > I think that there are a few issues being discussed here. > > 1. Best practice for OpenJPA when running with servers/containers > implementing the TransactionSynchronizationRegistry is to use this > interface to register for transaction events of interest. There is a > well-known JNDI name for the instance that implements the interface > when running in a standard Java EE 5 environment. So this should be > done in preference to other proprietary mechanisms. > > But this interface is not guaranteed to be available if running in > older servers. In particular, AFAIK, Websphere does not yet ship a > product that implements this interface. So, Agree. TransactionSynchronizationRegistry is the preferred method for Java EE 5 environments. 2. For pre-TSR servers, what do we do? Best practice here is to use > the proprietary mechanisms of the servers, but do so in a way that > does not require the implementation to be dependent on the > proprietary interfaces unless running in that environment. Agree, as long as the interfaces being used are public and documented (as your next bullet outlines). 3. I don't see an issue using proprietary (public, documented) > interfaces as an alternative to TSR. This is a time-honored way to > get what you need given what is available. Agree again. I've just looked at the implementation of *ManagedRuntime in the > org.apache.openjpa.ee package and found best practice 2 to be > implemented. Nice job, Marc (attribution in code). Yes, the implementation provided is flexible enough for the various application servers. The "problem" is with WebSphere's access to the TransactionManager. For reasons that do not directly pertain to this discussion, access to the WebSphere TM was not made available via public, documented interfaces until WAS 5.1. Previous to this, the undocumented, internal TransactionManagerFactory interfaces were used by several vendors. Since these internal interfaces can change and have changed in the past, WAS eventually provided the ExtendedJTATransaction interface. Using TSR will require a non-trivial change to the classes in the > package. In particular, there will need to be a definition of an > interface that performs the required registrations without a real > implementation of TransactionManager. > > I don't believe that this is a reason to hold up the release. I hope > we will be supporting pre-Java EE 5 servers for several years to come. Agree. That's why I voted neutral. I didn't want to hold up the release. Just wanted to voice my concern with the use of these internal interfaces. Mike and I are working on an update. Thanks. Craig > > On Oct 18, 2006, at 3:39 PM, Marc Prud'hommeaux wrote: > > > Kevin- > > > > On Oct 18, 2006, at 2:43 PM, Kevin Sutter wrote: > > > >> -0 > >> > >> Although it looks like you already have the three +1 votes to > >> publish the > >> 0.9.5 release, I'm hesitant with this publish since the current > >> OpenJPA > >> implementation is using internal WebSphere methods. I knew about the > >> problem of not using the TransactionSynchronizationRegistry interface > >> (OPENJPA-61), but I didn't realize the implications of using internal > >> WebSphere methods to get around this issue. Specifically, OpenJPA > >> is using > >> the following method: > >> > >> com.ibm.ws.Transaction.TransactionManagerFactory.getTransactionManage > >> r > > > > Is this a problem because you would like to see OpenJPA using more > > modern methods of getting at the TM, or because there are other > > serious consequences to calling this method? Note that Kodo has > > been using this method fine for years, and it looks like a number > > of other popular frameworks (Spring, Castor, and Hibernate, after > > some quick Googling on the method name) also use this method to get > > the WAS TM, so it doesn't seem uncommon. > > > >> I would like to see this get resolved before we publish the 0.9.5 > >> release. > >> The OPENJPA-61 report has two aspects to it. One is to use the > >> new JTA > >> interface for Java EE 5 compliant environments. That's one > >> problem. But, > >> the other, more immediate, problem is to remove the usage of internal > >> WebSphere methods for existing WebSphere environments. We will > >> attempt > >> resolve this immediate problem first. And, then worry about the > >> TransactionSynchronizationRegistry. > > > > If it is just a matter of using a more modern method to get the > > same TM functionality, then we can pretty quickly implement this by > > adding a new WASManagedRuntime that gets the TM in whatever way we > > want. However, if it doesn't work with older WAS versions, we > > should keep the old method around as well, since otherwise people > > won't have any way of integrating with this version. > > > > Ideally, of course, everything would move towards the > > TransactionSynchronizationRegistry, but as I mentioned in > > OPENJPA-61, we currently rely internally on having a > > javax.transaction.Transaction instance for both managed and stand- > > along transactions. The quickest route to getting this to work > > would be to make some > > TransactionSynchronizationRegistryTransactionManagerFacade that > > returns a TransactionFacade implementation of > > javax.transaction.Transaction whose begin()/commit() methods are > > just no-ops or throw exceptions (since I don't think the Broker > > should ever be calling those methods when the > > "openjpa.TransactionMode" is set to "managed"). > > > > However, I haven't yet experimented with a container that supports > > the TransactionSynchronizationRegistry, so that implementation work > > would be best done by someone who has experience with one of those > > containers (hint :) > > > > Anyway, in conclusion, I'm happy to see an update to the methods > > through which the transaction integration is performed provided we > > don't break backwards compatibility with older versions. I'd also > > rather not hold up 0.9.5 just for this ... we can always cut a new > > release pretty quickly once we get the updated integration working > > and tested, but in the near term, it'd be nice to get something out > > there beyond the nightly snapshots that people can start relying on. > > > > > >> Thanks, > >> Kevin > >> > >> On 10/18/06, Abe White wrote: > >>> > >>> +1 > >>> ____________________________________________________________________ > >>> ___ > >>> Notice: This email message, together with any attachments, may > >>> contain > >>> information of BEA Systems, Inc., its subsidiaries and > >>> affiliated > >>> entities, that may be confidential, proprietary, copyrighted > >>> and/or > >>> legally privileged, and is intended solely for the use of the > >>> individual > >>> or entity named in this message. If you are not the intended > >>> recipient, > >>> and have received this message in error, please immediately > >>> return this > >>> by email and then delete it. > >>> > > > > Craig Russell > Architect, Sun Java Enterprise System http://java.sun.com/products/jdo > 408 276-5638 mailto:Craig.Russell@sun.com > P.S. A good JDO? O, Gasp! > > > > ------=_Part_55970_5560918.1161224620674--