Thanks so much.

  Note: forwarded message attached.



Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup
--- Begin Message ---

Thanks for the reply.

1. bar() is another bean so ((MyBeanLocal)sessionContext.getEJBLocalObject()).bar() won't work, right?

This raises another question from my side:

2. Whenever you call another method of the same API, do you have to do it throught an interface as above?? This could be quite expensive specially when you don't have a local interface. Or Im getting it wrong?

My original questions still remain unanswered:

3. Regardless of "Required" or "RequiresNew" when I setRollbackOnly() in bar() it throws javax.transaction.RollbackException! It should not throw an exception according to EJB2.0 specs (see 18.3.6) b.

4. Even if it is throwing it, why is it throwing javax.transaction.RollbackException and not javax.ejb.TransactionRolledbackLocal Exception ?

Desparately needing answers. BTW what's a good forum to ask EJB questions?

Thanks very much.

  Jon Swinth <[EMAIL PROTECTED]> wrote:

You are most likely already doing this, but make sure you are using the interface to call bar().
If you don't, JBoss can't catch the method call in order to create a new Transaction and bar()
will be running in the same transaction as foo(). Like this from foo():

((YourBeanLocal)sessionContext.getEJBLocalObject()).bar()

On Tuesday 25 June 2002 01:19 am, [EMAIL PROTECTED] wrote:
> Date: Mon, 24 Jun 2002 18:42:56 -0700 (PDT)
> From: Alice Ad <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [JBoss-user] Transactions & Exceptions
> Reply-To: [EMAIL PROTECTED]
>
> --0-571750025-1024969376=:98575
> Content-Type: text/plain; charset=us-ascii
>
>
>  Hello,
> I'm having problem understanding some concepts or may be there's something
> weird going on in my code. MySessionBean is a statless bean. foo() in it
> has a "Required" trans-attribute MyEntityBean has a local interface. bar()
> in it has a "RequiresNew" trans-attribute (changing it to "Required"
> produces the same problems). foo() calls bar(). ->
> In bar(), I explicitly call EJBContext's setRollbackOnly(). ->
> foo() gets javax.transaction.RollbackException.
> My questions are:
> a. I don't think doing a setRollbackOnly() should throw an exception
> according to EJB2.0 specs (see 18.3.6) b. Even if it should throw it, why
> is it throwing javax.transaction.RollbackException and not
> javax.ejb.TransactionRolledbackLocal Exception ? Thanks very much for any
> help.
>  


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup--- End Message ---

Reply via email to