0

I am using Postgre sql as backend. I am connecting using postgre jdbc driver. I am executing batch of 5 records. I have put unique constartins in one column. Now after 5 record adding into batch, I am executing batch. Now when I am executing this and in 3rd batch one record fauled due to unique contsratins that whole batch will aborted. rest all 3 (1st, 2nd, 4th) batch will executed. In MySQl only failed record will be aborted, Batch which contain faulty record will be executed properly. So Why this happen in Postgre sql? Is this expected behaiviour or Bug?

Nikunj Patel
  • 104
  • 1
  • 7
  • When using a transaction, everything should rollback when an error occurs. Otherwise, use a savepoint and rollback to this savepoint. And what engine do you use in MySQL? Most MySQL-engines don't support transactions. – Frank Heikens Feb 23 '15 at 13:56
  • I am using innodb engine in mysql. By the way my use case is to read data from file and insert that data into database. This data will be almost half million. So even if one record is failed other record should be insrted. Thats my requirment. – Nikunj Patel Feb 24 '15 at 04:27

0 Answers0