[Hibernate-JIRA] Created: (HHH-7166) Infinispan Hibernate RegionFactory doesn't allow user to have their own custom CommandFactory
by William Burns (JIRA)
Infinispan Hibernate RegionFactory doesn't allow user to have their own custom CommandFactory
---------------------------------------------------------------------------------------------
Key: HHH-7166
URL: https://hibernate.onjira.com/browse/HHH-7166
Project: Hibernate ORM
Issue Type: Bug
Affects Versions: 4.1.1
Reporter: William Burns
Attachments: 0001-Changed-command-factory-lookup-to-only-grab-the-hibe.patch
The hibernate infinispan module currently takes the first command factory returned.
{code}
// TODO: This is a hack, make it easier to retrieve in Infinispan!
return (CacheCommandFactory) ((Map) globalCr.getComponent("org.infinispan.modules.command.factories"))
.values().iterator().next();
{code}
This assumes that the hibernate infinispan command factory is the only one provided. If a user has their own command factory and attempts to use hibernate there is a chance that it will grab the incorrect command factory eventually causing a ClassCastException.
I have attached a patch that contains a simple fix, where basically it iterates through the factories and only pulls out the hibernate one.
There is also a small change that I changed the return type for the TransactionManagerLookup to use the interface instead of the hibernate specific one. This way it is easier for users to override the method.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years
[Hibernate-JIRA] Created: (HHH-7193) Transaction Rollback not clearing statement batch on Prepared Statement causes issues with statement caching
by Shawn Clowater (JIRA)
Transaction Rollback not clearing statement batch on Prepared Statement causes issues with statement caching
------------------------------------------------------------------------------------------------------------
Key: HHH-7193
URL: https://hibernate.onjira.com/browse/HHH-7193
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.1
Environment: Hibernate 4.1.1 and before
Any connection provider that allows statement caching (i.e. C3P0)
Reporter: Shawn Clowater
The AbstractBatchImpl closes the preparedStatement in a finally block but doesn't call clear in the event of a rollback. This can leave the preparedStatment in a weird state if any type of statement caching is being used.
The issue is easily fixed by adding a clearBatch() call to the statement prior to close. I was previously working around this by implementing my own BatchingBatcherFactory in Hib 3 but the API changed forcing me to look at it again. I figured I might as well provide a global fix.
I'll add a pull request once I get github sorted.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years