[weld-dev] persistence and transactions outside Java EE

Gavin King gavin.king at gmail.com
Tue Nov 24 14:40:48 EST 2009


All you need to do is let people use @TransactionAttribute on a
managed bean. The only things that make me uncomfortable about that
idea are:

* the package name javax.ejb
* the actual annotation name "@TransactionAttribute(REQUIRED)" (vomit)

but these are just cosmetic issues.

On Tue, Nov 24, 2009 at 2:24 PM, Dan Allen <dan.j.allen at gmail.com> wrote:
> I'm not necessarily saying we need a new type. But in your application, you
> could logically think of classes which don't use transactions and classes
> which do as different, and both distinct from classes which can passivate
> and cluster (which are EJBs).
>
> Perhaps it as simple as saying that a managed bean with @Transactional at
> the class level can inject a persistence context and its methods support
> transactions by default.
>
> -Dan
>
> On Tue, Nov 24, 2009 at 2:20 PM, Gavin King <gavin.king at gmail.com> wrote:
>>
>> I don't see why would want to introduce a new kind of thing. Just let
>> managed beans have declarative txns.
>>
>> Sent from my iPhone
>> On Nov 24, 2009, at 11:37 AM, Dan Allen <dan.j.allen at gmail.com> wrote:
>>
>> I was talking to someone about this topic post-Devoxx. I came up with an
>> idea that may be worth considering. Perhaps the Java EE platform can
>> recognize another class of bean that has persistence and transaction
>> capabilities, but not the rest of EJB. Here's my proposed breakdown, in
>> terms of airplane seat classes (I was on an airplane at the time).
>>
>> First class - EJB session bean
>> Business class - local transactional bean
>> Coach - Simple managed bean
>>
>> The main differientiator of a "business class bean" from an EJB is that it
>> would have the option to use local transactions, just like an
>> application-managed JPA persistence unit. It would also not support any HA
>> concerns. But it would be a drop in replacement for so-called "lightweight"
>> transaction beans that Spring offers.
>>
>> Then, we wouldn't need to do anything special in Weld / Seam 3. All we
>> would need is to be able to support these types of beans in a servlet
>> container, the same way that Weld supports those environments. But it would
>> be a standard part of Java EE (6 MR1 or 7).
>>
>> If we feel like we need to support this use case in Seam, then clearly
>> there is still something missing in Java EE.
>>
>> -Dan
>>
>> On Wed, Nov 18, 2009 at 6:10 PM, Gavin King <gavin.king at gmail.com> 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
>>> http://in.relation.to/Bloggers/Gavin
>>> http://hibernate.org
>>> http://seamframework.org
>>> _______________________________________________
>>> weld-dev mailing list
>>> 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
>
>
> --
> 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
>



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org


More information about the weld-dev mailing list