[Hibernate-JIRA] Created: (HHH-7103) Improve documentation on cache configuration
by Michael Nascimento Santos (JIRA)
Improve documentation on cache configuration
--------------------------------------------
Key: HHH-7103
URL: https://hibernate.onjira.com/browse/HHH-7103
Project: Hibernate ORM
Issue Type: Improvement
Components: documentation
Affects Versions: 4.1.0
Reporter: Michael Nascimento Santos
Documentation on how to properly configure cache is missing. Property hibernate.cache.region.factory_class is not referenced anywhere. It also should be mentioned that org.hibernate.cache.ehcache.EhCacheRegionFactory, which probably should be the most common choice, is located on its own jar, independent of hibernate-core.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 months
[Hibernate-JIRA] Created: (JPA-4) PersistenceUtil.isLoaded() fails with a ClassCastException in Websphere 7
by Mike Youngstrom (JIRA)
PersistenceUtil.isLoaded() fails with a ClassCastException in Websphere 7
-------------------------------------------------------------------------
Key: JPA-4
URL: http://opensource.atlassian.com/projects/hibernate/browse/JPA-4
Project: Java Persistence API
Issue Type: Bug
Affects Versions: 1.0.0
Environment: Websphere 7 Hibernate 3.5
Reporter: Mike Youngstrom
To duplicate deploy a .war with hibernate 3.5 to Websphere with the contextlistener below. You need to set the classloader to "parent last" so that your application will use Hibernate's JPA 2 API instead of Webspheres JPA 1 API.
package test;
import javax.persistence.Persistence;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class TestListener implements ServletContextListener {
@Override
public void contextDestroyed(ServletContextEvent arg0) {
}
@Override
public void contextInitialized(ServletContextEvent arg0) {
System.out.println("Result of isLoaded: "+Persistence.getPersistenceUtil().isLoaded(new Object()));
}
}
Throws the exception below.
It appears the problem is that PersistenceProviderResolverHolder.PersistenceProviderResolverPerClassLoader scans all of the classloader levels to find PersistenceProviders. This is finding Websphere's OpenJPA provider in a different classloader than the application and hence with a different JPA API. Although this example happens in Websphere 7 it would in theory also happen anytime Websphere is used in an app server with another JPA implementation that cannot be removed from the server.
java.lang.ClassCastException: com.ibm.websphere.persistence.PersistenceProviderImpl incompatible with javax.persistence.spi.PersistenceProvider
at javax.persistence.Persistence$1.isLoaded(Persistence.java:92)
at test.TestListener.contextInitialized(TestListener.java:20)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1681)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:374)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:299)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:100)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:166)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:731)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:616)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1122)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1315)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:623)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:940)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:725)
at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1266)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4509)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4687)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1271)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2043)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:439)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:382)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:653)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:615)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37)
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1086)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:967)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1320)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1213)
at com.ibm.ws.management.application.sync.StartDeploymentTask.startDeployment(StartDeploymentTask.java:236)
at com.ibm.ws.management.application.sync.StartDeploymentTask.fullAppUpdate(StartDeploymentTask.java:113)
at com.ibm.ws.management.application.sync.StartDeploymentTask.performTask(StartDeploymentTask.java:101)
at com.ibm.ws.management.application.sync.AppBinaryProcessor$ExpandApp.expand(AppBinaryProcessor.java:1556)
at com.ibm.ws.management.application.sync.AppBinaryProcessor.postProcessSynchronousExt(AppBinaryProcessor.java:654)
at com.ibm.ws.management.bla.sync.BLABinaryProcessor.postProcess(BLABinaryProcessor.java:569)
at com.ibm.ws.management.bla.sync.BLABinaryProcessor.onChangeCompletion(BLABinaryProcessor.java:451)
at com.ibm.ws.management.repository.FileRepository.postNotify(FileRepository.java:1915)
at com.ibm.ws.management.repository.FileRepository.update(FileRepository.java:1424)
at com.ibm.ws.management.repository.client.LocalConfigRepositoryClient.update(LocalConfigRepositoryClient.java:189)
at com.ibm.ws.sm.workspace.impl.WorkSpaceMasterRepositoryAdapter.update(WorkSpaceMasterRepositoryAdapter.java:655)
at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.update(RepositoryContextImpl.java:1954)
at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.synch(RepositoryContextImpl.java:1902)
at com.ibm.ws.sm.workspace.impl.WorkSpaceImpl.synch(WorkSpaceImpl.java:511)
at com.ibm.ws.management.configservice.ConfigServiceImpl.save(ConfigServiceImpl.java:703)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37)
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1086)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:967)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1320)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1213)
at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
at com.ibm.ws.management.connector.rmi.RMIConnectorService.invoke(RMIConnectorService.java:282)
at com.ibm.ws.management.connector.rmi._RMIConnectorService_Tie.invoke(_RMIConnectorService_Tie.java:395)
at com.ibm.ws.management.connector.rmi._RMIConnectorService_Tie._invoke(_RMIConnectorService_Tie.java:160)
at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:622)
at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:475)
at com.ibm.rmi.iiop.ORB.process(ORB.java:513)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:1574)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2841)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2714)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:63)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 months
[Hibernate-JIRA] Created: (OGM-120) Unable to find a GridType for org.hibernate.type.SerializableType
by Guillaume Scheibel (JIRA)
Unable to find a GridType for org.hibernate.type.SerializableType
------------------------------------------------------------------
Key: OGM-120
URL: https://hibernate.onjira.com/browse/OGM-120
Project: Hibernate OGM
Issue Type: Bug
Components: core
Affects Versions: 3.0.0.Alpha2
Reporter: Guillaume Scheibel
Attachments: org.hibernate.ogm.test.utils.StartTest-output.txt, org.hibernate.ogm.test.utils.StartTest.txt, persistence.xml, StartTest.java
When I try to retrieve an EntityManager via:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("mongoPU");
The mongoPU persistence unit is described in persistence.xml
I got an expection which tells me "Unable to build EntityManagerFactory" and in the stack trace there is:
Caused by: org.hibernate.HibernateException: Unable to find a GridType for org.hibernate.type.SerializableType
at org.hibernate.ogm.type.impl.TypeTranslatorImpl.getType(TypeTranslatorImpl.java:110)
So I looked into the TypeTranslatorImpl class and indeed there is no:
typeConverter.put( SerializableTypeDescriptor.INSTANCE, SerializableType.INSTANCE );
All files are in attachement.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 months
[Hibernate-JIRA] Commented: (HHH-1283) ScrollableResults JoinFetch don't set child collection correctly after the second parent object
by Tim Downey (JIRA)
[ https://hibernate.onjira.com/browse/HHH-1283?page=com.atlassian.jira.plug... ]
Tim Downey commented on HHH-1283:
---------------------------------
I agree with Frans...we've been applying and using the patch for a number of years with no side effects.
> ScrollableResults JoinFetch don't set child collection correctly after the second parent object
> -----------------------------------------------------------------------------------------------
>
> Key: HHH-1283
> URL: https://hibernate.onjira.com/browse/HHH-1283
> Project: Hibernate ORM
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1
> Environment: Hibernate 3.1
> Oracle10gR2
> Oracle JDBC Driver 10.2.0.1.0
> Sun JDK 1.5.0_06
> Spring 1.2.6
> Reporter: Masahiro Hirashima
> Attachments: fetch-scroll-collection-3.5.4.patch, ScrollableCollectionFetchingTest.java, ScrollableResults.zip
>
>
> ScrollableResults JoinFetch set child collection correctly at first parent object.
> but after the second parent object, It set only the first element of a child collection.
> I made the following tables.
> CREATE TABLE owners (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> first_name VARCHAR(30),
> last_name VARCHAR(30),
> address VARCHAR(255),
> city VARCHAR(80),
> telephone VARCHAR(20),
> version NUMBER(36, 0) DEFAULT 0
> );
> CREATE TABLE types (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> name VARCHAR(80),
> version NUMBER(36, 0) DEFAULT 0
> );
> CREATE TABLE pets (
> id NUMBER(36, 0) NOT NULL PRIMARY KEY,
> name VARCHAR(30),
> birth_date DATE,
> type_id NUMBER(36, 0),
> owner_id NUMBER(36, 0),
> version NUMBER(36, 0) DEFAULT 0
> );
> and inserted the following data.
> INSERT INTO owners VALUES (1, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749', 0);
> INSERT INTO owners VALUES (2, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763', 0);
> INSERT INTO pets VALUES (1, 'Leo', '2000-09-07', 1, 1, 0);
> INSERT INTO pets VALUES (2, 'Basil', '2002-08-06', 2, 1, 0);
> INSERT INTO pets VALUES (3, 'Rosy', '2001-04-17', 3, 2, 0);
> INSERT INTO pets VALUES (4, 'Jewel', '2000-03-07', 4, 2, 0);
> INSERT INTO pets VALUES (5, 'Iggy', '2000-11-30', 5, 2, 0);
> INSERT INTO types VALUES (1, 'cat', 0);
> INSERT INTO types VALUES (2, 'dog', 0);
> INSERT INTO types VALUES (3, 'lizard', 0);
> INSERT INTO types VALUES (4, 'snake', 0);
> INSERT INTO types VALUES (5, 'bird', 0);
> and I execute following code.
> String hqlJoinFetchTest =
> "from Owner owner " +
> "left outer join fetch owner.pets as pets " +
> "left outer join fetch pets.type " +
> "order by owner.firstName, owner.lastName";
> Query query = session.createQuery(hqlJoinFetchTest);
> ScrollableResults cursor = query.scroll();
> while ( cursor.next() ) {
> Owner owner = (Owner)cursor.get(0);
> System.out.println(owner);
> }
> result of this code is following.
> petclinic.domain.Owner@15d616e[id=1,version=0,firstName=Betty,lastName=Davis,
> petclinic.domain.Pet@136d9d8[id=2,version=0,name=Basil,birthDate=2002-08-06,
> petclinic.domain.PetType@1be2893[id=2,version=0,name=dog]
> petclinic.domain.Pet@14a75bb[id=1,version=0,name=Leo,birthDate=2000-09-07,
> petclinic.domain.PetType@17779e3[id=1,version=0,name=cat]
> petclinic.domain.Owner@e3570c[id=2,version=0,firstName=Eduardo,lastName=Rodriquez
> petclinic.domain.Pet@167e3a5[id=4,version=0,name=Jewel,birthDate=2000-03-07,
> petclinic.domain.PetType@1926e90[id=4,version=0,name=snake]
> First owner object set collection collectly.
> but second owner object don't set second pet object(id=5) and third pet object(id=6).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 10 months