Reputation: 47
We are currently migrating from Oracle to SAP Hana, and we are using Java-programs that access the database via JDBC.
When I do a SQL-update to the Hana database in Java, this change is not written to the database.
After the update, I use Squirrel to check whether the table has been changed and the change is not visible!
How can I write data with UPDATE, INSERT and DELETE in Hana via JDBC?
Upvotes: 1
Views: 420
Reputation: 10396
As SipCat found out himself, this behavior is caused by
autocommit=false
COMMIT
ing the changes made by the application.In this situation, the transaction will be rolled back when the application disconnects the DB session.
Several SQL Editor/Query UI tools (like DBSquirrel) use autocommit=true
or automatically issue a COMMIT
after each command, so that it may appear that there is no COMMIT
required or that no transaction handling would be involved.
That is a false impression. In fact, even SELECT
s (which "just" read data) technically are always in a transaction context.
Upvotes: 1