[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-07 Thread dabramov
Thanks for the discussion - it's been very helpful coming up to speed on this...

In the case of a same EJB call, is there any difference between doing 

A) 
@EJB SameEJB same; 

vs:

B)
@Resource SessionContext ctx;
... 
SameEJB same = ctx.getBusinessObject();

I'm guessing in B) you get a local if you're working w/ a local intf, vice 
versa. How does @EJB deal w/ local deal w/ that?

-Dan





View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949624#3949624

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949624


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-07 Thread dbudworth
Not having looked at the actual implementation for injection, I'd guess that

  | @EJB
  | private SameEJB same;
  | 

I would expect that it doesn't give you a self referencing proxy.

It probably at best give an error that it's not legal
At worst give you infinite recursion as it would be creating new instances to 
inject and new instances for those injected beans to have more injections, etc.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949639#3949639

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949639


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-07 Thread dabramov
I tried calling SessionContext.getBusinessObject() and also 
SessionContext.getInvokedBusinessInterface() from a SLSB method. However, I get 
an IllegalStateException - Not Implemented. 

(aside: any reason to not to call getInvokedBusinessInterface() vs 
getBusinessObject()? It seems simpler to not have to pass in the interface)
@Stateless
  | public class FooBean implements FooLocal {
  | 
  | @Resource SessionContext ctx;
  | public static Logger log = Logger.getLogger( FooBean );
  | 
  | public void doSomething() {
  | log.info( doSomething: enter);
  | 
  | //Foo thisFoo = (Foo)ctx.getBusinessObject( FooLocal.class );
  | Foo thisFoo = (Foo)ctx.getInvokedBusinessInterface();
  | 
  | log.info( got business interface:  + thisFoo );
  | } 
  | }
I see the enter log message, but nothing after.

I guess there are two choices - either I'm not using this correctly or it's 
really not implemented. Bill - should this work w/ RC7? If not, would we expect 
this for a GA release of EJB3?

As to using the JBoss AOP @Tx mixed w/ EJB3 syntax, I don't think I can sell 
that to our group. It seems messy to adopt EJB3 only to sprinkle in a 
proprietary syntax to get the desired to our group. 

Thanks,
-Dan

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949688#3949688

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949688


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-06 Thread Stefan Arentz
dbudworth wrote : We ended up turning on full blown LoadTimeWeaving AOP and 
using @Tx for this situation.
  | 

Uhhh. Does that mean that transaction management in EJB3 is completely broken?

 S.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949286#3949286

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949286


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-06 Thread Stefan Arentz
dbudworth wrote : We ended up turning on full blown LoadTimeWeaving AOP and 
using @Tx for this situation.
  | 

David, did you simply let your @Tx annotation do an 'em.joinTransaction()' as 
if the persistence context was application managed?

 S.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949349#3949349

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949349


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-06 Thread [EMAIL PROTECTED]
dbudworth wrote : we found that the TransactionAttribute annotation gets 
ignored when calling other methods in from a session bean.
  | 
  | ie:
  | 
  |   | public void doSomething() {  // this is the method called from the 
client
  |   | doSomethingInNewTx();
  |   | }
  |   | 
  |   | @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  |   | public void doSomethingInNewTx(){
  |   |  ...
  |   | }
  |   | 
  |   | 
  | 
  | But calling doSomethingInNewTx() from the client would actually create the 
tx.  (guess you have to be going through the proxy to get the annotation to do 
it's thing)
  | 
  | We ended up turning on full blown LoadTimeWeaving AOP and using @Tx for 
this situation.
  | 

This is the expected behavior and what is required by the specification.  If 
you make a this pointer method call, it is a regular Java invocation.  You can 
get an EJB this pointer through SessionContext method getBusinessObject (or 
whatever the name is, i forget).

Bill

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949355#3949355

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949355


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-06 Thread Stefan Arentz
[EMAIL PROTECTED] wrote : dbudworth wrote : This is the expected behavior 
and what is required by the specification.  If you make a this pointer method 
call, it is a regular Java invocation.  You can get an EJB this pointer 
through SessionContext method getBusinessObject (or whatever the name is, i 
forget).
  |   | 
  | 
  | This sounds rather silly/complicated. Maybe it is time for another 
JBoss-specific  extension to the spec to make this (a whole lot) easier?
  | 
  |  S.
  | 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949357#3949357

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949357


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-06 Thread Stefan Arentz
Sorry for the badly quoted message :-)

 S.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949358#3949358

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949358


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-06 Thread [EMAIL PROTECTED]
Like dbudworth said, you can use the AOP stuff if you need to.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949372#3949372

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949372


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-06 Thread dbudworth
I didn't even realize you could get the proxy object from the context, might 
have been a better solution.  

The @Tx stuff works, and I've been using the JBoss AOP stuff for a few years in 
production, so I don't really worry about that (aside from the 1/3 increase in 
deploy time, but that's no biggie)

As for adding a jboss specific hack, doing that would kind of suck, think about 
all the places you do things like:

  | Logger log = Logger.getLogger(getClass());
  | 

You'd end up with a funky subclass in your log files, since the only way to 
make self references adhear to the annotations would be to generate a subclass 
or use LoadTimeWeaving. (I believe)

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949520#3949520

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949520


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-05 Thread dabramov
I ran my test in the debugger. When the TxTestBean is deployed I see the 
TxInterceptorFactory create a new instance of a TxInterceptor.RequiresNew for 
the part3() method. However when the test is executed, a breakpoint set on 
TxInterceptor.RequiresNew.invoke() never gets hit.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949230#3949230

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949230


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: Help w/ TransactionAttributeType.REQUIRES_NEW

2006-06-05 Thread dbudworth
we found that the TransactionAttribute annotation gets ignored when calling 
other methods in from a session bean.

ie:

  | public void doSomething() {  // this is the method called from the client
  | doSomethingInNewTx();
  | }
  | 
  | @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  | public void doSomethingInNewTx(){
  |  ...
  | }
  | 
  | 

But calling doSomethingInNewTx() from the client would actually create the tx.  
(guess you have to be going through the proxy to get the annotation to do it's 
thing)

We ended up turning on full blown LoadTimeWeaving AOP and using @Tx for this 
situation.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3949248#3949248

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3949248


___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user