-
Oct 10th, 2012, 08:57 AM
#1
Open new transaction in @AfterJob event?
Hi,
Is it possible to open a new transaction in @AfterStep or @AfterJob event?
I am seeing that when I try to execute a SQL query the current transaction is closed.
Thanks,
-
Oct 10th, 2012, 10:44 AM
#2
There's nothing stopping you from wrapping those calls in your own transactions. However, there is nothing within the framework that provides those methods to be transactional.
-
Oct 10th, 2012, 11:11 AM
#3
Finally, I solved this problem by opening manually the transaction:
TransactionTemplate transactionTemplate = new TransactionTemplate(transactionManager);
totImp = transactionTemplate.execute(new TransactionCallback<BigDecimal>() {
@Override
public BigDecimal doInTransaction(TransactionStatus status) {
(some code....)
}
});
Any better idea?
Thanks,
Tags for this Thread
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