wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Transactional and Extended Scoped Persistence Context does not work as per spec. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Transactional and Extended Scoped Persistence Context does not work as per spec." Watch "Transactional and Extended Scoped Persistence Context does not work as per spec." New topic
Author

Transactional and Extended Scoped Persistence Context does not work as per spec.

pulkit mehra
Greenhorn

Joined: Jun 05, 2008
Posts: 12
Hi Ranchers,

I am preparing for SCBCD.I am stuck in below specs .(Using Jboss 4.2.1 and EJB 3.0)
It is being said in specs:

<<
If a stateless session bean, message-driven bean, or stateful session bean with a transaction-scoped persistence context calls a stateful session bean with an extended persistence context in the same JTA transaction, an IllegalStateException is thrown.
>>

Unfortunately i am not getting this error, though it does not pass the PC (Persistence Context).

Transactional Scoped SFSB


Extended Scope PC SFSB


Am i missing something or have incorect knowledge of Specs.

Thanks in Advance.
Joe carco
Ranch Hand

Joined: Apr 14, 2009
Posts: 82
I tried what you described on Glassfish 3.1, and that is exactly what happens: when a SLSB with transactional context calls my SFSB with extended context entitymanager I get the following exception:



Maybe you should use a 100% certified JEE5 Server. All I know about JBoss 4.2.x is that its not a JEE 5 certified app server, so perhaps its missing one or the other spec.
Try it on Glassfish 3 / 3.1 or JBoss 5.1.

pulkit mehra
Greenhorn

Joined: Jun 05, 2008
Posts: 12
Thanks Joe for your quick response.
I will definately try this on JBoss5.1 and will post the result.
pulkit mehra
Greenhorn

Joined: Jun 05, 2008
Posts: 12
Hi Ranchers,

I have tried JBoss5.1 with above said scenario and result is same(no EJBException) .
What is wrong with JBoss5. Does it implies to EJB 3.0 spec or not.
I had a very good impression of JBoss Community till now but i am afraid all has been changed since this post.
They have ignored very basic and important spec.

Please post if anyone got it right, i will be more than happy to use JBoss again.

Pulkit
Joe carco
Ranch Hand

Joined: Apr 14, 2009
Posts: 82
Looks like you've discovered a bug - or is it a feature?

I checked it too on JBoss 5.1 - got the same results as you. JBoss for some reason allows this specification violation concerning extended contexts.
Glassfish is the reference implementation of all Java EE specs, so maybe its best to practice SCBCD stuff with Glassfish.
Still, I find it very disappointed to find out that a supposedly Java EE certified application server allows this sort of spec violation.
Maybe its worth to check the JBoss bug list to see if its a known issue. Next I think I'll try JBoss 6 CR1 to see if it behaves the same way. I'll post my results here
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Transactional and Extended Scoped Persistence Context does not work as per spec.