Announcement Announcement Module
Collapse
No announcement yet.
Runtime Exception results in an infinite loop Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
Working...
X