[
https://hibernate.onjira.com/browse/HHH-7166?page=com.atlassian.jira.plug...
]
Galder Zamarreno commented on HHH-7166:
---------------------------------------
William, I'll have your suggestion included as part of
https://hibernate.onjira.com/browse/HHH-7179. AS7 guys are happy with it too.
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
Assignee: Galder Zamarreno
Fix For: 4.1.2
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