>>>What we are doing is forcing EJB on people that want a transactional bean. That's really the problem that I see.
Yeap, this is a problem and mistake. Besides,  EJB technology is much more than transactions.(security, pooling, clustering, integration, messaging etc.)

Also, *transaction* is a generic term. Java EE defines distributed transactions over JTA and JTS specifications. Web containers do not required to implement those specifications. 

If you do not like to use EJB transaction demarcation model, there are several choices that people can use for their web applications

1* Manage your JTA transactions over third party Transaction Managers
2* Give up it to the Java EE containers.
3* Do not use JTA, then manage your JDBC connections with your own solutions or some third party libraries

But each one has also an advantage or disadvantage? If you look at EJB 3.1 specification, it is very very easy to integrate lots of cool functionality into your application.

Thanks;

--Gurkan


From: Dan Allen <dan.j.allen@gmail.com>
To: Gurkan Erdogdu <gurkanerdogdu@yahoo.com>
Cc: reza_rahman@lycos.com; Weld-Dev <weld-dev@lists.jboss.org>
Sent: Tue, November 24, 2009 10:46:34 PM
Subject: Re: [weld-dev] persistence and transactions outside Java EE

On Tue, Nov 24, 2009 at 3:44 PM, Gurkan Erdogdu <gurkanerdogdu@yahoo.com> wrote:
Actually OpenEJB works great as an embeddable.

Just dowloand openejb.war, deploy it into tomcat/webapp that is it! You can use all EJB container functionality in your web applications!

Great news. That's the simplicity we need to offer (or else we just lose people).
 

Actually the point is that EJB  is just a technology related with Java EE distribution model/architecture. Its usage heavily depends on where you would like to use it. If you want to create a (simple) web application that depends on single database resource, maybe it is not necessary to include EJBs into your application. But if you would like to use 2PC (for example, integrating JMS with Databases etc.), to distribute your business code into more than one machine , to integrate with legacy CORBA systems or other messaging systems etc. you could likely to use EJBs in Java EE environment.

Yes and no. What we are doing is forcing EJB on people that want a transactional bean. That's really the problem that I see.

-Dan

--
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