Announcement Announcement Module
Collapse
No announcement yet.
Using TransactionCallback Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using TransactionCallback

    Hello,

    I am new to this forum and I am sure my question may have been answered already.
    My search did not yield any results. Hence this post.

    I have a code as follows -

    public void insertCustomer(CustomerVO customerVO) {
    transactionTemplate.execute(new TransactionCallback(){
    public Object doInTransaction(TransactionStatus arg0) {
    customerDAO.insertCustomer(customerVO); // syntax error here
    return null; // I don't want to return null. Just a place holder
    }
    });
    }

    The code is syntactically not correct. The customerVO object cannot be referenced like this.
    However this is exactly what I want to achieve. I want to be able to pass objects inside the
    doInTransaction() method.

    Any best way of achieving this?

    I would appreciate any pointers on this.

    Thanks,

  • #2
    Any best way of achieving this?
    Make customerVO final E.g.
    public void insertCustomer(final CustomerVO customerVO) {

    Comment


    • #3
      Thanks a ton katentim.

      Comment

      Working...
      X