[weld-dev] persistence and transactions outside Java EE
Reza Rahman
reza_rahman at lycos.com
Tue Nov 24 11:51:40 EST 2009
Guys,
This is something I've been grappling with lately. The conclusion I've
reached myself is that given the pervasive anti-JTA/JCA propaganda Gavin
mentions, it is wise to provide a non-JTA/JCA *option* that is available
if you configure it. The *option* part is critical because I think Java
EE centric embedded solutions should still support JTA/JCA with a
recommendation on why using it is a good idea and why it makes sense as
the default choice that you get unless you explicitly configure things
to use a non-JTA/JCA transaction manager.
If this is too difficult, I do tend to agree with Gavin that an embedded
solution should just provide a non-JTA/JCA transaction manager while a
server-based solution provides a JTA/JCA solution, given the likely
"target audience" for an embedded solution running on Tomcat/Jetty.
Just my two cents...
Cheers,
Reza
Dan Allen wrote:
> You are correct that for various reasons, many developers are fixated
> on Tomcat and Jetty. However, I do believe that if there are
> embeddable Java EE alternatives, such as Embedded JBoss AS, then the
> grip on servlet containers will loosen.
>
> What these developers want is to be able to deploy their app over top
> of Maven (or whatever build tool offers this feature). They like the
> automatic download of the server and the "in place" style deployment.
> I'm sure there are some other features I'm overlooking, but in the
> end, it comes down to zero configuration and overall simplicity.
> Having to boot up and application server as a service is just not as
> appealing. But that isn't out of the reach of Java EE.
>
> -Dan
>
> On Mon, Nov 23, 2009 at 12:34 PM, Gavin King <gavin.king at gmail.com
> <mailto:gavin.king at gmail.com>> wrote:
>
> Yes, I understand the need for XA enlistment, but JBoss Transactions
> is already able to do that, right? What I'm saying is that you would
> use the TransactionalDriver together with a pool. Or does
> TransactionalDriver already do pooling?
>
> Yes, I understand that this is primitive compared to JCA. But we're
> dealing with the users who claim they don't want or need an
> application server. They, for their own, mostly incomprehensible,
> reasons, *want* to use Tomcat or Jetty or something without a JCA
> layer, together with one of the very inferior pooling solutions that
> are available in that environment. And they've been told for years by
> the Spring crowd that it's a good idea and that they should keep doing
> it.
>
> Now, you and I both know this to be a total load of bunk, but we have
> tried to argue with these people and it is futile. They read it in
> books, so it must be true. We all know that a couple of years of
> exposure to Spring turns good developers into drooling, brain-damaged
> automatons who believe anything you tell them as long as you wave
> around enough underspecified jargon like "lightweight" and remind them
> how much EJB sucked 5 years ago.
>
> Now, if you know of a good, reasonably easy to use standalone JCA
> layer, I'm all ears, but AFAIK, there's nothing really available in
> this space.
>
> On Mon, Nov 23, 2009 at 12:19 PM, Jonathan Halliday
> <jonathan.halliday at redhat.com
> <mailto:jonathan.halliday at redhat.com>> wrote:
> >
> > None of the pools is XA aware - they will pool standard
> connections, but not
> > XA ones that need XAResource enlistment to the JTA tx. The
> > TransactionalDriver in JBossTS will do that, but it's pretty
> primitive
> > compared to a real JCA.
> >
> > Jonathan.
> >
> > On 11/23/2009 05:16 PM, Gavin King wrote:
> >>
> >> Ah. Standalone JCA is a problem. But do we really need JCA, or
> can we
> >> just let Hibernate use one of the standalone connection pools
> that it
> >> ships with?
> >>
> >> On Mon, Nov 23, 2009 at 7:13 AM, Pete Muir<pmuir at redhat.com
> <mailto:pmuir at redhat.com>> wrote:
> >>>
> >>> I chatted to Jonathan about this, he tells me the binary for
> JBossTS JTA
> >>> is under 1MB with no external dependencies other than the JTA
> API (but we
> >>> would probably need standalone JCA too).
> >>>
> >>> On 18 Nov 2009, at 23:10, Gavin King wrote:
> >>>
> >>>> I think we should try and follow the Java EE models as closely as
> >>>> possible for this stuff. We should simply try and make the
> Java EE
> >>>> code work outside EE 6.
> >>>>
> >>>> e.g.
> >>>>
> >>>> (1) use a resource declaration with
> @PersistenceContext(unitName=....)
> >>>> to define a managed persistence context
> >>>> (2) use JBoss Transactions to manage transactions in a
> servlet engine
> >>>> - so instead of having a special tx manager for JDBC, it is
> just JTA
> >>>>
> >>>> Or is the 10meg download for JBoss Transactions just no good?
> >>>>
> >>>> --
> >>>> Gavin King
> >>>> gavin.king at gmail.com <mailto:gavin.king at gmail.com>
> >>>> http://in.relation.to/Bloggers/Gavin
> >>>> http://hibernate.org
> >>>> http://seamframework.org
> >>>> _______________________________________________
> >>>> weld-dev mailing list
> >>>> weld-dev at lists.jboss.org <mailto:weld-dev at lists.jboss.org>
> >>>> https://lists.jboss.org/mailman/listinfo/weld-dev
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> > --
> > ------------------------------------------------------------
> > Registered Address: Red Hat UK Ltd, Amberley Place, 107-111
> Peascod Street,
> > Windsor, Berkshire, SI4 1TE, United Kingdom.
> > Registered in UK and Wales under Company Registration No. 3798903
> > Directors: Michael Cunningham (USA), Charlie Peters (USA), Matt
> Parsons
> > (USA) and Brendan Lane (Ireland)
> >
>
>
>
> --
> Gavin King
> gavin.king at gmail.com <mailto:gavin.king at gmail.com>
> http://in.relation.to/Bloggers/Gavin
> http://hibernate.org
> http://seamframework.org
>
> _______________________________________________
> weld-dev mailing list
> weld-dev at lists.jboss.org <mailto:weld-dev at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/weld-dev
>
>
>
>
> --
> Dan Allen
> Senior Software Engineer, Red Hat | Author of Seam in Action
> Registered Linux User #231597
>
> http://mojavelinux.com
> http://mojavelinux.com/seaminaction
> http://www.google.com/profiles/dan.j.allen
> ------------------------------------------------------------------------
>
> _______________________________________________
> weld-dev mailing list
> weld-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/weld-dev
More information about the weld-dev
mailing list