Skip to content

Negative buffer size on Firebird 2.5 if information response is 32KiB or greater #894

@mrotteveel

Description

@mrotteveel

Split off from #876

could this problem also apply to 5.0.9 jaybird? we have been experiencing a lot of connection problems after updating from 5.0.1.java8 to 5.0.9.java 11 (we are still stuck with a firebird 2.5 unfortunately).

in particular, we get

Could not open JDBC Connection for transaction; nested exception is org.firebirdsql.jdbc.FBSQLException: You cannot getAutoCommit on an unassociated closed connection. org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.firebirdsql.jdbc.FBSQLException: You cannot getAutoCommit on an unassociated closed connection. at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:313) at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction

and

PreparedStatementCallback; SQL [whatever]; This connection is closed and cannot be used now.; nested exception is org.firebirdsql.jdbc.FBSQLException: This connection is closed and cannot be used now. at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:107) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate

Interestingly, this error did not emerge right after deployment, but 6 hours later when the first heavy load nightly batch job was scheduled.

After that, it randomly and inconsistently caused problems - sometimes on the first jdbc query, sometimes later. We obviously checked our code for unintentional connection closing, but literally nothing changed there - only the version update of jaybird.


Image Image

The very first exception I have received might be interesting though:

SQLNonTransientConnectionException: Unsupported or unexpected operation code 352583681 in processOperation [SQLState:08000, ISC error code:337248276]
...
Caused by: java.sql.SQLNonTransientConnectionException: Unsupported or unexpected operation code 352583681 in processOperation [SQLState:08000, ISC error code:337248276] at org.firebirdsql.gds.ng.FbExceptionBuilder$Type$4.createSQLException(FbExceptionBuilder.java:664) at org.firebirdsql.gds.ng.FbExceptionBuilder$ExceptionInformation.toSQLException(FbExceptionBuilder.java:571) at org.firebirdsql.gds.ng.FbExceptionBuilder.toSQLException(FbExceptionBuilder.java:309) at org.firebirdsql.gds.ng.wire.AbstractWireOperations.processOperation(AbstractWireOperations.java:217) at org.firebirdsql.gds.ng.wire.AbstractWireOperations.readOperationResponse(AbstractWireOperations.java:175) at org.firebirdsql.gds.ng.wire.AbstractWireOperations.readResponse(AbstractWireOperations.java:169) at org.firebirdsql.gds.ng.wire.AbstractFbWireDatabase.readResponse(AbstractFbWireDatabase.java:222) at org.firebirdsql.gds.ng.wire.version10.V10Transaction.finishTransaction(V10Transaction.java:135) at org.firebirdsql.gds.ng.wire.version10.V10Transaction.rollback(V10Transaction.java:105) at org.firebirdsql.jaybird.xca.FBManagedConnection.internalRollback(FBManagedConnection.java:886) at org.firebirdsql.jaybird.xca.FBLocalTransaction.rollback(FBLocalTransaction.java:127) at org.firebirdsql.jdbc.InternalTransactionCoordinator$AutoCommitCoordinator.statementCompleted(InternalTransactionCoordinator.java:362) at org.firebirdsql.jdbc.InternalTransactionCoordinator.statementCompleted(InternalTransactionCoordinator.java:134) at org.firebirdsql.jdbc.FBStatement.notifyStatementCompleted(FBStatement.java:286) at org.firebirdsql.jdbc.FBPreparedStatement.notifyStatementCompleted(FBPreparedStatement.java:167) at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:149) at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:797) at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:709) at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:703) at org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:294) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108) at org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:75) at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108) at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81) at jdk.proxy3/jdk.proxy3.$Proxy583.prepareStatement(Unknown Source) at org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:235) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:646) ... 112 more

I got this exception multiple times, in each parallel thread executed for the batch job.


What I cannot understand though, is that when I was hotfixing later, restarting the application (including the tomcat application server) did result in the error showing up right after deployment, unlike the first time, where it only occured after a while. Database connectivity should have been arround the same, since we deployed both with blue/green during prime time.

And restarting firebird did not help either.

Originally posted by @ambition-consulting in #876

Sub-issues

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions