Results 1 to 2 of 2

Thread: Transaction abort by JDBC driver?

  1. #1
    Join Date
    Aug 2004
    Location
    Germany, Magdeburg
    Posts
    279

    Default Transaction abort by JDBC driver?

    I am experiencing a strange problem:

    I fired an optimistic insertion. The insert fails due a violation of a unique constraint. Since it fails, I wanted to throw an exception in the business layer and continue using a compensation operation.

    Saidly by executing the compensation operation (even on select), I was informed that the transaction is aborted and the operation is ignored. So I burried my head in the Spring sources but there was no transaction abort on any level (I use SqlOperation subclasses).

    So I guess the abortion is done by the jdbc-driver. I am using a PostgreSQL 8.0 database with the 3.* jdbc driver.


    Is it really not possible to recover from a sql-exception and to do anything alternatively? Or is Spring responsable for this abort?


    Cheers,

    Martin (Kersten)

  2. #2
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    Martin,

    Sounds like a jdbc/database limitation. Spring does not do anything special here. If you have a current transaction, once your statement fails your entire transaction should fail. If you want to do additional work, you need to start a new transaction.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

Similar Threads

  1. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  2. Replies: 0
    Last Post: Jun 6th, 2005, 06:22 AM
  3. Transaction Management
    By caverns in forum Data
    Replies: 3
    Last Post: Mar 8th, 2005, 06:38 AM
  4. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  5. Transaction pb Hibernate/MySQL
    By syluser in forum Data
    Replies: 2
    Last Post: Aug 28th, 2004, 02:40 PM

Posting Permissions

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