Announcement Announcement Module
Collapse
No announcement yet.
txAdvice for Inner Class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • txAdvice for Inner Class

    Hi All,
    I have implemented a business class that has a inner class, which will do some data validation in a seperate thread. The code looks like this:

    public class ServiceImpl implements Service {

    public submitData(List _data) {
    saveData(_data);
    ValidationThread t = new ValidationThread(_data);
    t.start();
    }

    public class ValidationThread extends Thread {
    private List data = null;
    public ValidationThread(List _data){
    this.data = _data;
    }
    public void run() {
    validateData(data);
    saveErrors();
    }
    }

    And I need the TxManager to start a new transaction for the new thread, how I should do it? Refer to the method like $ValidationThread.start in the txAdvice?

    Thanks in advance
Working...
X