How Big Is The Entire EJB 3.1 API Needed To Compile Your Session Beans?

To test your EJBs outside the container, you will need to have the EJB 3.1 annotations available in your classpath. In my past projects we even deployed EJB 3.0 components directly to RCP application. We could start and test the application without even having an application server. The application server is going to be introduced later - in future version of the app.

The recurring question was: how big is the jar needed for compiling / unit test of the EJB 3 pojos? The preview of EJB 3.1 distributed with Glassfish prelude v3 (javax.ejb-10.0-SNAPSHOT.jar) is: 42.2 KB (not MB). It contains most of the EJB 3.1 annotations. In most applications only the "mainstream" annotations are used - so the size of the jar can be further optimized to few KBs...

Comments:

Adam,
Don´t you intend to have your books translated to english?
Regards,
Marcelo

Posted by Marcelo Alcantara on September 01, 2008 at 04:25 PM CEST #

Marcelo,

no - but I'm working on one for oreilly right now (straight in English - indirections are always problematic). I promised not to reveal the publishing date :-)

Thank you for the suggestion!,

adam

Posted by Adam Bien on September 01, 2008 at 04:53 PM CEST #

Very cool! However, a big part of EJB is container managed transactions and we'll expect that in our unit tests. Will we have to configure EJB 3.1 container to use JTA? Is JTA also a single .jar file?

I would like to see an example test case that starts up the container, tests a session bean with JPA & CMT, then shuts down the container. Ideally the transaction would be rolled back after the test completed successfully.

Posted by Ryan de Laplante on September 01, 2008 at 05:41 PM CEST #

Can you tell us the topic of your new book? I haven't read this book but I think the idea is a good one:

http://www.amazon.com/Development-using-GlassFish-Application-Server/dp/1847192602/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1220278717&sr=8-1

I'd like to have a single book that covers EJB 3.1, JPA 2.0, JSF 2.0 and GlassFish V3 (advanced topics including clustering).

Posted by Ryan de Laplante on September 01, 2008 at 05:50 PM CEST #

Hi Ryan,

"...Very cool! However, a big part of EJB is container managed transactions and we'll expect that in our unit tests. "

Not necessarily. You can manage the transactions directly, in case e.g. JPA is involved. Stay tuned!
"I would like to see an example test case that starts up the container, tests a session bean with JPA & CMT, then shuts down the container"

I do it now, with EJB 3.0 - without even having a container :-).

Posted by Adam Bien on September 02, 2008 at 03:14 PM CEST #

Ryan,

"I'd like to have a single book that covers EJB 3.1, JPA 2.0, JSF 2.0 and GlassFish V3"

I'm using already GF v3 for my tests, together with Netbeans 6.5 (no time for fiddling around with plugins :-)).

However I do not plan to introduce those technologies, rather than concrentrate on efficiency and best practices.

thank you for your comments!,

adam

Posted by Adam Bien on September 02, 2008 at 03:16 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments
License