[hibernate-issues] [Hibernate-JIRA] Created: (HHH-7166) Infinispan Hibernate RegionFactory doesn't allow user to have their own custom CommandFactory

William Burns (JIRA) noreply at atlassian.com
Mon Mar 12 12:18:48 EDT 2012


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

        


More information about the hibernate-issues mailing list