-->
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: Hibernate transaction is not active,but no exception
PostPosted: Wed May 21, 2008 2:35 pm 
Beginner
Beginner

Joined: Mon Apr 07, 2008 12:49 pm
Posts: 33
Hey,

Using in hibernate 3.3.
Working with JBoss server4.2

Background:
I have a DAO(stateless bean- transaction required) and in the DAO i call to entitymanager.makeTransient(obj)

i have an observer mechanism that use the database to register subscribers.
I have a registration table and when object is register as a subscriber i register it in the registration table.
There is no FK from the registration to any other table.

I have a callback on "pre-remove" , so when object delete in the system i remove all the registration unit that belong to it.
i do it in hibernate callback , because i want it to do it also on the cascade delete objects.

The problem:
During the cascade i get the exception - LazyInitilazionException - transaction is not active.

In some point during hibernate delete (and cascade) the transaction mark for roll back, but i don’t see when. i don’t see any exception in the log that cause to the transaction to mark for roll back.

Any idea will be more than welcome.
I don’t know from where to begin. i change the log level to trace, but didn’t see any exception that cause to roll back.

Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 21, 2008 3:32 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
If the 3.3 version is indeed accurate you are quite adventurous replacing what comes with JBoss AS as the EJB3 persistence layer. I would not do that.

Anyway, post your code and let's see what's going on here...

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


Top
 Profile  
 
 Post subject: I dont see any problem to upgrade the version
PostPosted: Wed May 21, 2008 4:05 pm 
Beginner
Beginner

Joined: Mon Apr 07, 2008 12:49 pm
Posts: 33
Any way my mistake in this env i use in the default persistence layer that shipped with JBoss (core= 3.2.3.ga).

The DAO (Ejb3 stateless):
Code:
   public void makeTransient(final ManagedElement entity) throws IMDaoException {
         getEntityManager().remove(entityFromDB);

   }


in orm.xml i register a callback for pre-remove on all entities that extend observer

and in the pre-remove:
I have code that query for all registration on this object , and remove them.

The pre-remove call to a stateless (Ejb3) , which find all and remove.

The issue is that i dont see any exception that cause the transaction to be closed.

Thank you


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.