[h2] Re: Use of COMMIT TRANSACTION

2023-09-15 Thread Nils Tolleshaug
Thanks! Much better solution and seems like COMMIT and ROLLBACK works as expected. Nils fredag 15. september 2023 kl. 09:54:43 UTC+2 skrev Evgenij Ryazanov: > Hello! > > These commands aren't going to work. > > You need to disable auto-commit, execute your commands and commit or > rollback

[h2] Re: Use of COMMIT TRANSACTION

2023-09-15 Thread Evgenij Ryazanov
Hello! These commands aren't going to work. You need to disable auto-commit, execute your commands and commit or rollback your transaction. In JDBC, you can use Connection.setAutoCommit(false), Connection.commit(), and Connection.rollback(). In SQL you can use SET AUTOCOMMIT OFF, COMMIT, and

[h2] Re: Use of COMMIT TRANSACTION

2023-09-15 Thread Nils Tolleshaug
If I run this in H2 console: SET AUTOCOMMIT FALSE; PREPARE COMMIT PERS_DEL; COMMIT TRANSACTION PERS_DEL; the commands works, however: Connection dataH2conn; connectString = "jdbc:h2:" + urlH2loc + ";IFEXISTS=TRUE"; dataH2conn = DriverManager.getConnection(connectString, userId, passWord);