Did something change with the prepared statement cache? (WF22 -> WF24 update)

417 views
Skip to first unread message

Davy Koravand

unread,
Jul 12, 2021, 10:32:36 AM7/12/21
to WildFly
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.

John Schneider

unread,
Oct 12, 2021, 6:30:17 PM10/12/21
to WildFly
I'm running into the same problem upgrading from Wildfly 20 to 25.  I've matched the SQL Server driver versions, and downgraded WF25 Hibernate to 5.3.17 but it makes no difference.  I think there was a change within Wildfly causing this.

Were you able to workaround this problem another way?  I'd like to keep using a prepared statements cache.

Davy Koravand

unread,
Oct 13, 2021, 3:32:44 AM10/13/21
to WildFly
I was unable to find a fix, I'm stuck on WildFly 23.

Op woensdag 13 oktober 2021 om 00:30:17 UTC+2 schreef john.sc...@xyops.com:

John Schneider

unread,
Oct 13, 2021, 12:29:36 PM10/13/21
to WildFly
The following issue has been created: https://issues.redhat.com/browse/WFLY-15493

Brian Stansberry

unread,
Oct 13, 2021, 12:35:56 PM10/13/21
to WildFly

Thank you for filing the issue!
Reply all
Reply to author
Forward
0 new messages