[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-22 Thread adver11
anonymous wrote : @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  | @TxSynchronized

REQUIRES_NEW?The annotated method is executed within a newly generated 
transaction.If the caller method is already in a transaction, it is suspended. 
@TxSynchronized : When a @TxSynchronized member method is called, the object 
instance's lock monitor is held for the duration of  the transaction, until it 
commits or  rolls back. When a @TxSynchronized annotated static method or 
constructor  is invoked, the Class's lock monitor  is held for the duration of 
the transaction.  This lock works like synchronized, in that the lock is only 
acquired when a tagged member is called.

I think it can solve the clash.

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-22 Thread elkner
Not sure, what you are trying to accomplish with it, however, where do you 
know, 
1) that's the EM has only ONE instance of an SLSB? 
2) that there is only one EM, which manages the SLSB?
3) that not another instance of something accesses your bean from within 
another ClassLoader?
4) Scaleability is not an issue for you ?

Even if it would work like synchronized, what do you expect/does it buy you? Do 
you expect, that the method gets always an entity passed, with the latest 
committed state? If so, I think you have wrong assumptions...

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-22 Thread adver11
So, use @Version? Use Version field each table? but applications that use more 
than one
Version property or field will not be portable.

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-22 Thread adver11
elkner, Should you give me a example about using 
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) 
,@TxSynchronized,@Version? 
thanks.

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-22 Thread elkner
http://docs.jboss.org/ejb3/app-server/HibernateEntityManager/reference/en/html_single/index.html#transactions-optimistic
http://docs.jboss.org/ejb3/app-server/HibernateEntityManager/reference/en/html_single/index.html#transactions

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-21 Thread elkner
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) ?

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-21 Thread adver11
elkner, Are you sure? 

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-21 Thread elkner
Well, at least if you use a kind of optimistic locking via @Version one of both 
should fail and the failed transaction should be rolled back (of course only, 
if your are not chomping the Exceptions, which automatically trigger the 
rollback ;-)). Just make sure, that you call em.flush() after merge to be able 
to catch the exception inside the bean method (i.e. actually before the JTA is 
finished).

If the method does just a simple merge of a simple bean, it might be even 
relyable without having a NEW TA, since hibernate should catch the problem on 
flush via @Version.

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-21 Thread adver11
But, catch the Exception not all. I want to solve the clash about protect the 
Entity Instance object from concurrent access. Like synchronized keyword in 
regular JavaBean, to limited only one can access the object at the same time.

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - Re: How to protect an object from concurrent access in EJB3.

2006-03-21 Thread adver11
this complexion also about some resource, like Queue. In PTP mode, we want only 
one send the message to the Queue at the same time.

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

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


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user