Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Spring Transaction oddities

I am using Spring 2.5.6 and @Transactional annotation within my DAO classes. 
I have run into an issue where I had put the @Transactional annotation at
the the top of one my DAO classes and in one the the methods it makes calls
to a couple of other DAO classes to do some select queries using NamedQuery
calls.  This seemed to be working for me until it was run on the client
machine.  

Turns out that because the method is in side a class with the @Transactional
it creates a transaction boundary there.  My other DAO makes a Select
Distinct call which for DB2 escalates it to a *SHRNUP lock.  Then inside the
same method it calls a 3rd DAO which also does a SELECT Distinct and then
fails with a FILE in Use SQLException.  The first oddity is that it seems to
work fine in our environment, but not the client. 

To get beyond this, I have tried removing the @Transactional totally as
transaction isnt necessarily needed, or atleast just put them on the methods
where the actual calls are taking place.  The two SQL calls being made in
the DAO are StoredProcedureCalls and when I remove them or move them to just
around those methods, I get nullpointers calling
getActivePersistenceContext.

So why does this seem to work when @Transaction is at the class level but
not when it's just at the method level?


-- 
View this message in context: http://www.nabble.com/Spring-Transaction-oddities-tp23504895p23504895.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top