sqljdbcfirebirdjaybird

Insert or update query executed successfully but data are not persistent


I'm trying to insert or update elements in an existing Firebird database using JDBC. I access the database with the default credentials (SYSDBA and masterkey).

The request are done successfully according to JDBC, but the database is not modified (when I execute a select my data does not appear). I also tried to modify the database content using software like RazorSQL, the result is the same (the database is modified during the session, but if I disconnect and reconnect to the database my modifications are lost).

Does anybody have an idea how to solve this problem?


Solution

  • Most likely you are running with autoCommit disabled. In that case you need to explicitly call commit() on the Connection. Also be aware that a transaction can only see changes from transactions that were committed before it started.

    See also the Jaybird JDBC Driver Java Programmer's Manual, chapter "Using transactions".