-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Transaction Serialization (Container-Managed Transactions)
PostPosted: Mon Sep 25, 2006 4:01 am 
Newbie

Joined: Wed May 31, 2006 6:40 am
Posts: 19
Hibernate version:
JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)
09:44:58,001 INFO [Version] Hibernate EntityManager 3.2.0.CR1
09:44:58,266 INFO [Version] Hibernate Annotations 3.2.0.CR1
09:44:58,298 INFO [Environment] Hibernate 3.2 cr2

Name and version of the database you are using:
SQL Server 2005

I'm trying to have a Transaction Serialization with jboss 4.0.4.GA but with the default configurations seems to fail.

i read that by default a stateless EJB3 bean is configured with

@TransactionAttribute(TransactionAttributeType.REQUIRED)

Maybe i don't understand very well the boundaries of this transaction... i'd like to have serialization... when a thread start executing a method no other thread can enter the same method since in this method first i read some resources, then i allocate

i read http://java.sun.com/javaee/5/docs/tutor ... tion3.html and seems to me that the default TransactionAttribute should be fine but i practice i get that 2 transaction interfering each other :(

thanks to all!!!!


Top
 Profile  
 
 Post subject: Re: Transaction Serialization (Container-Managed Transaction
PostPosted: Mon Sep 25, 2006 4:37 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
icecuber wrote:
@TransactionAttribute(TransactionAttributeType.REQUIRED)


This has nothing to do with isolation level you are writing about / want.

Set isolation on db connection or write your own synch code.


Top
 Profile  
 
 Post subject: Re: Transaction Serialization (Container-Managed Transaction
PostPosted: Mon Sep 25, 2006 6:16 am 
Newbie

Joined: Wed May 31, 2006 6:40 am
Posts: 19
alesj wrote:
icecuber wrote:
@TransactionAttribute(TransactionAttributeType.REQUIRED)


This has nothing to do with isolation level you are writing about / want.

Set isolation on db connection or write your own synch code.


the semantic i'd like to achieve is that if a transaction is on the run a second transaction is queued.... or at least to explain a lock management

how can i got an exclusive lock on objects i'm going to read from db?

I try to add this tag to my datasource configuration

<transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>


in fact i see differencies.... 2 transaction can run simultaneously but only one (the first started i suppose) can commit successfully... the other got an exception....

Full stack trace of any exception that occurs:
12:09:44,278 WARN [JDBCExceptionReporter] SQL Error: 1205, SQLState: 40001
12:09:44,278 ERROR [JDBCExceptionReporter] Transaction (Process ID 59) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
12:09:44,278 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.LockAcquisitionException: could not update: [com.kirio.S3.ejb3.entity.FilePerOrdinePostoPerDataEvento#20]

i have to sync in a clustered jboss enviroment.... how to do it???

i'm also thinking about message bean... i don't know if it's applicable...

pls I'M LOST!!!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.