Hi,
I use the @Transactional annotation for my transaction management within my application. Not JTA but resource-local and JPA Transaction Manager is my platform transaction manager class
I am facing a peculiar problem...
I got a method X() which retrieves a set of records to be processed and within that method I got a method Y() which is to be run in a new transaction context. So here is the source code:
@Transactional
public void X(){
List<Records> rec = manager.getAllRecsForProcessing();
for(Record a:rec){
Y(rec);
}
}
@Transactional
public void Y(Record rec){
//Do Processing
}
When I run this I got each processing of Y() tied to the main transaction started by X(). I want Y to start a new transaction context...Can I run Y() using Propagation.REQUIRES_NEW as from the javadoc it states that this can be run only in a JTA environment ?
Can someone please point out how to go about a situation like this.
Thanks in advance
Rgds...VJ


Reply With Quote
