-
May 26th, 2009, 01:42 PM
#1
Runtime Exception results in an infinite loop
Hi,
I wanted to try out how RuntimeExceptions of Transactional-tagged methods in my service layer are handled by the Transaction Manager.
I assumed that the Transaction Manager rollbacks the transaction and propagates the Exception.
Here's my code:
// ... ServiceBean:
@Transactional
public synchronized void persistNewFileEntry(FileEntry fileEntry) {
fileEntryDao.insert(fileEntry);
throw new RuntimeException("test");
}
After the RuntimeException occurs, the Transaction Manager rolls back the Transaction as assumed.
But then the Service Layer method is executed again resulting in an inifinite loop.
Anyone an idea?
Many thx in advance.
rgds, thomas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules