cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC driver bug in Connection.setSavepoint()?

Former Member
0 Kudos

The driver seems to generate invalid SQL. Here's the error that I get when calling Connection.setSavepoint()

com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "SAVEPOINT": line 1 col 1 (at pos 1)

          at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:334)

          at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.generateDatabaseException(SQLExceptionSapDB.java:174)

          at com.sap.db.jdbc.packet.ReplyPacket.buildExceptionChain(ReplyPacket.java:103)

          at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:875)

          at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:654)

          at com.sap.db.jdbc.StatementSapDB.sendCommand(StatementSapDB.java:896)

          at com.sap.db.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:945)

          at com.sap.db.jdbc.StatementSapDB.execute(StatementSapDB.java:255)

          at com.sap.db.jdbc.StatementSapDB.execute(StatementSapDB.java:224)

          at com.sap.db.jdbc.SavepointSapDB.setSavepoint(SavepointSapDB.java:162)

          at com.sap.db.jdbc.ConnectionSapDB.setSavepoint(ConnectionSapDB.java:1555)

          at com.sap.db.jdbc.trace.Connection.setSavepoint(Connection.java:492)

          at com.knoa.commons.sql.Connection.setSavepoint(Connection.java:466)

I'm using version 1.0 of the driver against HANA 1.0. Java version is 1.6

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bogdan,

we are looking after this issue now. The basic problem is likely that HANA does not yet support transaction checkpoints. Even the Java documentation states that setSavepoint() is not a feature of the JDBC driver, but that of the underlying RDBMS.

Stay tuned ...

-Michael

Former Member
0 Kudos

Right, but then it would be better to fail early and throw an UnsupportedOperationException (or similar) instead of sending invalid SQL to the DB.

Former Member
0 Kudos

No disagreement about that ... didn't want to imply that just because the documentation says it may not be supported, the driver is allowed to fail in the most ungraceful way 😉  Wouldn't hurt to just throw an NotSupportedException exception.

Former Member
0 Kudos

Confirmed from dev - yes, we don't support savepoints. Sorry. I requested a more graceful form of failure.

Cheers,

Michael

former_member71842
Associate
Associate
0 Kudos

Hello Michael,

Is there any plan to include savepoint support in the near future?

Answers (0)