Hi all,
We are updating WildFly 22 to 24 and came across an issue with the prepared statement cache. Our default settings in the mssql datasource are as follows:
<statement>
<prepared-statement-cache-size>200</prepared-statement-cache-size>
<share-prepared-statements>true/share-prepared-statements>
</statement>
When starting up WildFly, some of our sql-related code is failing due to the following exception:
com.microsoft.sqlserver.jdbc.SQLServerException: The statement is closed.
at com.mssql//com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:234)
at com.mssql//com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(SQLServerStatement.java:1065)
at com.mssql//com.microsoft.sqlserver.jdbc.SQLServerStatement.setMaxRows(SQLServerStatement.java:1117)
at org.jboss.ironjac...@1.4.35.Final//org.jboss.jca.adapters.jdbc.CachedPreparedStatement.setMaxRows(CachedPreparedStatement.java:550)
at org.jboss.ironjac...@1.4.35.Final//org.jboss.jca.adapters.jdbc.WrappedStatement.setMaxRows(WrappedStatement.java:647)
When we change the configuration above to 0 / false to disable prepared statement caching, it seems to work fine. What change in the WildFly update could have caused this? I see that ironjacamar has been updated from 23-24 and I looked through the commit history of that project but I can't find the cause. I'm not sure if this is a WildFly bug.