On 2/20/2016 6:20 PM, Sridhar N Bamandlapally wrote:
> from Java/jdbc code, conn.setAutoCommit(false)
>
> insert into employee values(1, 'K1');
> insert into employee values(1, 'K1');
> insert into employee values(2, 'K2');
>
> by looking at exceptions i may rollback or commit, i.e.
> conn.rollback() or conn.commit()
> if I rollback table should be empty,
> if I commit table should have 2 rows
>
> is there any way is possible ?
turn on autocommit if you want each INSERT to be run atomically
independent of the other inserts.
this is going in circles, we've explained a dozens how postgres and jdbc
works.
--
john r pierce, recycling bits in santa cruz