[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7166) Infinispan Hibernate RegionFactory doesn't allow user to have their own custom CommandFactory
William Burns (JIRA)
noreply at atlassian.com
Fri Mar 30 09:54:48 EDT 2012
[ https://hibernate.onjira.com/browse/HHH-7166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46132#comment-46132 ]
William Burns commented on HHH-7166:
------------------------------------
Awesome!
Thanks again, Galder.
> 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
More information about the hibernate-issues
mailing list