Results 1 to 3 of 3

Thread: handling DataAccessException

  1. #1
    Join Date
    Jun 2006
    Posts
    3

    Arrow handling DataAccessException

    public void updateMethod(byte[] b) {
    try {
    JdoTemplate jdoTemplate = getJdoTemplate();

    ...update statements...

    jdoTemplate.flush();
    }
    catch(DataAccessException dae) {
    ...msg is displayed in the page..
    System.out.println ("DataAccessException...");
    }

    }

    this method accepts a csv file and save the records in the db.
    If there is an invalid record, the transaction is rolled back so no records were added.
    DataAccessException is caught & a msg is displayed in the page.
    However, a nested exception error is still printed in the console.
    Why is a nested exception still appears or what causes it? and more importantly, how to stop error msg from being printed into the console..?

    console:
    DataAccessException...
    org.springframework.orm.jdo.JdoResourceFailureExce ption: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.; nested exception is kodo.util.FatalDataStoreException: at......
    at....

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    Configure your logging system properly. Spring uses Commons Logging. Normally you use log4j underneath and should have an appropriate log4j.properties file that does *not* print to the console and suppresses any messages you want suppressed.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Jun 2006
    Posts
    3

    Default

    Thanks for the reply.
    I'll read on configuring log4j.
    You may have known some good materials I'll greatly appreciate it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •