This content has been marked as final.
Show 2 replies
-
1. Re: How to configure prepared-statement-cache-size in a XA DataSource with IJ Embedded ?
virendra656 May 14, 2018 8:41 AM (in response to sewatech)Did you find any answer for the problem?
-
2. Re: How to configure prepared-statement-cache-size in a XA DataSource with IJ Embedded ?
sewatech Oct 22, 2018 2:25 AM (in response to virendra656)Our latest workaround is to drop IronJacamar of our project, as I think that the Embedded part is no more an active feature.
But I guess that it's not a useful answer if you've encountered the same problem.
The problem come from the deployer which is incomplete.
It can be worked around with a custom deployer like this :
public class CustomDsXmlDeployer extends org.jboss.jca.deployers.fungal.DsXmlDeployer { @Override protected ManagedConnectionFactory createMcf(XaDataSource ds, String uniqueId, ClassLoader cl) throws Exception { ManagedConnectionFactory mcf = super.createMcf(ds, uniqueId, cl); if (mcf instanceof BaseWrapperManagedConnectionFactory) { BaseWrapperManagedConnectionFactory managedConnectionFactory = (BaseWrapperManagedConnectionFactory) mcf; Statement statement = ds.getStatement(); Long preparedStatementsCacheSize = statement.getPreparedStatementsCacheSize(); if (preparedStatementsCacheSize != null) { managedConnectionFactory.setPreparedStatementCacheSize(preparedStatementsCacheSize.intValue()); } managedConnectionFactory.setSharePreparedStatements(statement.isSharePreparedStatements()); Statement.TrackStatementsEnum trackStatements = statement.getTrackStatements(); if (trackStatements != null) { managedConnectionFactory.setTrackStatements(trackStatements.toString()); } Validation validation = ds.getValidation(); if (validation != null) { managedConnectionFactory.setCheckValidConnectionSQL(validation.getCheckValidConnectionSql()); Extension exceptionSorter = validation.getExceptionSorter(); Extension validConnectionChecker = validation.getValidConnectionChecker(); if (validConnectionChecker != null) { managedConnectionFactory.setValidConnectionCheckerClassName(validConnectionChecker.getClassName()); } Extension staleConnectionChecker = validation.getStaleConnectionChecker(); if (staleConnectionChecker != null) { managedConnectionFactory.setStaleConnectionCheckerClassName(staleConnectionChecker.getClassName()); } if (exceptionSorter != null) { managedConnectionFactory.setExceptionSorterClassName(exceptionSorter.getClassName()); } } return managedConnectionFactory; } return mcf; } }