[Hibernate-JIRA] Created: (ANN-742) Primary key should not be set on nullable column
by Miroslav Havram (JIRA)
Primary key should not be set on nullable column
------------------------------------------------
Key: ANN-742
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-742
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.1.GA
Environment: hibernate core 3.2.6.GA
Reporter: Miroslav Havram
Attachments: create_scripts.zip, test_case.zip
After switching to hibernate-annotations 3.3.1.GA, DDL generated for intermediate table for optional one-to-one association tries to set
primary key on nullable column. Problem is that some DBMSs (e.g. MS SQL) do not allow that.
Using hibernate-annotations-3.3.0.GA:
create table personAddress (address_id bigint not null, person_id bigint not null, primary key (person_id))
Using hibernate-annotations-3.3.1.GA:
create table personAddress (person_id bigint, address_id bigint, primary key (person_id))
Simple test case and generated DDLs are attached.
--
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
15 years, 8 months
[Hibernate-JIRA] Created: (HHH-2124) HibernateException hidden during flush using XA with WAS6
by Ole Dalgaard (JIRA)
HibernateException hidden during flush using XA with WAS6
---------------------------------------------------------
Key: HHH-2124
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2124
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1.2, 3.1.3
Environment: Hibernate 3.1.3
Oracle 10G
Websphere Application Server 6
Reporter: Ole Dalgaard
In an XA environment, using WebSphereExtendedJTATransactionLookup, HibernateExceptions are hidden during flush in this code in CacheSynchronization.java
try {
if (flush) {
log.trace("automatically flushing session");
ctx.managedFlush();
}
}
catch (RuntimeException re) {
setRollbackOnly();
throw re;
}
After adding some logging to CacheSynchronization.beforeCompletion I got this error message:
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
at org.hibernate.collection.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:410)
at org.hibernate.event.def.OnUpdateVisitor.processCollection(OnUpdateVisitor.java:40)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java(Compiled Code))
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java(Compiled Code))
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java(Compiled Code))
at org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:123)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:267)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:216)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:502)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:494)
at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:134)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java(Inlined Compiled Code))
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java(Compiled Code))
at org.hibernate.engine.Cascade.cascade(Cascade.java(Compiled Code))
at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:130)
at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:121)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:60)
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:136)
at $Proxy11.beforeCompletion(Unknown Source)
at com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java(Compiled Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java(Compiled Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java(Compiled Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java(Compiled Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java(Compiled Code))
at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java(Compiled Code))
at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java(Compiled Code))
at com.ibm.ejs.csi.TranStrategy.commit(TranStrategy.java:716)
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:167)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:569)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3801)
at com.ibm.ws.webservices.dispatchers.ejb.WSEJBWrapper.postInvoke(WSEJBWrapper.java:153)
at com.ibm.ws.webservices.dispatchers.ejb.J2ee14EJBDispatcher.cleanupEnvironment(J2ee14EJBDispatcher.java:197)
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invoke(JAXRPCHandler.java:148)
at com.ibm.ws.webservices.engine.handlers.WrappedHandler.invoke(WrappedHandler.java:64)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:279)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:341)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:673)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1804)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:469)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:408)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Without modifying CacheSynchronization I only get this:
WTRN0074E: Exception caught from before_completion synchronization operation: java.lang.UnsupportedOperationException
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter.setRollbackOnly(WebSphereExtendedJTATransactionLookup.java:211)
at org.hibernate.transaction.CacheSynchronization.setRollbackOnly(CacheSynchronization.java:77)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:67)
at org.hibernate.transaction.WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter$TransactionAdapter$1.invoke(WebSphereExtendedJTATransactionLookup.java:136)
at $Proxy11.beforeCompletion(Unknown Source)
at com.ibm.ws.jtaextensions.SynchronizationCallbackWrapper.beforeCompletion(SynchronizationCallbackWrapper.java:65)
at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java(Compiled Code))
at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java(Compiled Code))
.....
I use these transaction settings for hibernate:
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
<property name="hibernate.transaction.flush_before_completion">true</property>
<property name="hibernate.transaction.auto_close_session">true</property>
--
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
15 years, 8 months
[Hibernate-JIRA] Created: (HHH-3350) Error in creating Schema update script: if exist a view in Oracle db and exist a class with @Entity for this, then raises the "ORA-01702: a view is not appropriate here" exception
by Béla Berecz (JIRA)
Error in creating Schema update script: if exist a view in Oracle db and exist a class with @Entity for this, then raises the "ORA-01702: a view is not appropriate here" exception
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-3350
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3350
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Reporter: Béla Berecz
(sorry for my bad english)
When deploying:
16:28:03,737 INFO [SchemaUpdate] Running hbm2ddl schema update
16:28:03,737 INFO [SchemaUpdate] fetching database metadata
16:28:04,128 INFO [SchemaUpdate] updating schema
...
16:28:59,565 WARN [JDBCExceptionReporter] SQL Error: 1702, SQLState: 42000
16:28:59,565 ERROR [JDBCExceptionReporter] ORA-01702: a view is not appropriate here
16:28:59,565 ERROR [SchemaUpdate] could not complete schema update
org.hibernate.exception.SQLGrammarException: could not get table metadata: TABLE_VIEW
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:105)
at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:954)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:140)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy66.start(Unknown Source)
at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:120)
at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:551)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:333)
at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy33.start(Unknown Source)
at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy34.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: ORA-01702: nézet itt nem fordulhat elő
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1614)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1579)
at oracle.jdbc.OracleDatabaseMetaData.getIndexInfo(OracleDatabaseMetaData.java:3485)
at com.p6spy.engine.spy.P6DatabaseMetaData.getIndexInfo(P6DatabaseMetaData.java:210)
at org.hibernate.tool.hbm2ddl.TableMetadata.initIndexes(TableMetadata.java:130)
at org.hibernate.tool.hbm2ddl.TableMetadata.<init>(TableMetadata.java:35)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:90)
... 150 more
Problem with TableMetadata.java row 35: initIndexes(meta);
I couldn't create index for view in Oracle, hence (I think) drop a SQLGrammarException when running initIndexes(meta).
--
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
15 years, 9 months
[Hibernate-JIRA] Created: (HHH-2599) Inconsistent behaviour with Cascade Refresh and lazy loaded collections
by Guy Chua (JIRA)
Inconsistent behaviour with Cascade Refresh and lazy loaded collections
-----------------------------------------------------------------------
Key: HHH-2599
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2599
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: 3.2.3, hsqldb/mysql
Reporter: Guy Chua
Attachments: cascadeTest.zip
According to the specs for session.refresh(), the state of the given instance will be re-read from the database. I have a model 'Company' that has 2 lazy collections, departments and employees.
Snippet of class Company
--------------------------------------------------------------------
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
Snippet of class CascadeTestRunner
--------------------------------------------------------------------
public void doRefreshTest() {
session = sessionFactory.openSession();
session.getTransaction().begin();
Company loadedCompany = (Company)session.get(Company.class, companyId);
logger.debug(loadedCompany);
// session.refresh(loadedCompany); // POINT A
session.close();
Set<Department> loadedDepartments = loadedCompany.getDepartments();
logger.debug("TEST for LAZY DEPARTMENTS [START]");
for (Department tmpDepartment : loadedDepartments) {
logger.debug(tmpDepartment); // POINT B
}
logger.debug("TEST for LAZY DEPARTMENTS [END]");
Set<Employee> loadedEmployees = loadedCompany.getEmployees();
logger.debug("TEST for LAZY EMPLOYEES [START]");
for (Employee tmpEmployee : loadedEmployees) {
logger.debug(tmpEmployee); // POINT C
}
logger.debug("TEST for LAZY EMPLOYEES [END]");
}
If I run the above code, Point B will give me LazyInitializationException which is the expected behavior. But if i uncomment POINT A, the LazyInitializationException happens at POINT C instead of POINT B. Why should POINT B pass and POINT C fail?
Furthermore, with POINT A still uncommented and when I swap the position of POINT 1 with POINT 2, the LazyInitializationException happens at POINT B now. I am wondering why the position of the fields produce the exception at a different location.
What happens when a lazy collection annotated with CascadeType.Refresh is refreshed? I am getting varied results, sometimes the collection is initialized, sometimes it is not. Is it supposed to cascade the refresh to lazy elements in the first place?
Hope someone can shed some light on this.
Test Results
------------------
1. LazyInitializationException at POINT B
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
// session.refresh(loadedCompany); // POINT A
logger.debug(tmpDepartment); // POINT B
logger.debug(tmpEmployee); // POINT C
2. LazyInitializationException at POINT C
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
session.refresh(loadedCompany); // POINT A
logger.debug(tmpDepartment); // POINT B
logger.debug(tmpEmployee); // POINT C
2. LazyInitializationException at POINT B when positions of POINT 1 and POINT 2 are swapped
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 2
private Set<Employee> employees; // POINT 2
@OneToMany (mappedBy="company", cascade={ CascadeType.ALL }) // POINT 1
private Set<Department> departments; // POINT 1
session.refresh(loadedCompany); // POINT A
logger.debug(tmpDepartment); // POINT B
logger.debug(tmpEmployee); // POINT C
--
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
15 years, 9 months
[Hibernate-JIRA] Created: (HHH-3642) EJB3 inheritance strategy TABLE_PER_CLASS does not work on HSQLDB
by Wolfgang Knauf (JIRA)
EJB3 inheritance strategy TABLE_PER_CLASS does not work on HSQLDB
-----------------------------------------------------------------
Key: HHH-3642
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3642
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.1
Environment: JBoss 5.0GA, Java 1.6, Hypersonic 1.8.0.8
Reporter: Wolfgang Knauf
Attachments: InheritanceTablePerClass.ear
I use an EJB3 entity bean with inheritance strategy "TABLE_PER_CLASS":
@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class Base implements Serializable
{
...
When loading a list of base classes, all subclass fields are null. The union subclause in the query does not work on HSQLDB.
Attached is a full EJB sample, runnable on JBoss 4.2/5.0 (project export of Eclipse 3.4/WebTools 3.0 with sources). After deploying, it can be tested by browsing to http://localhost:8080/InheritanceTablePerClassWeb/
See this output:
...
Loading ALL
Item: Child 1, child field 1: null
Item: Child 2, child field 2: null
Item: Child 3, child field 3: Field of Child3
...
Here, all childs are loaded. The fields of type "Child1" and "Child2" are null, fields of type "Child3" are filled.
This is probably a duplicate of http://opensource.atlassian.com/projects/hibernate/browse/HHH-2920
The described workaround to change all NULL expressions to "cast (null as VARCHAR)" results in a working query, but I see no chance to pre-configure this query in the entity manager.
I created another bug, because the impact is different (it breaks a feature of EJB3), and so I consider severity to be higher.
--
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
15 years, 9 months
[Hibernate-JIRA] Created: (BVAL-41) Support BeanInfo implementation to receive property names
by Emmanuel Bernard (JIRA)
Support BeanInfo implementation to receive property names
---------------------------------------------------------
Key: BVAL-41
URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-41
Project: Bean Validation
Issue Type: Improvement
Components: spec-general
Reporter: Emmanuel Bernard
Michael
- Why section 3.1.2 requires properties to follow the JavaBeans naming
convention? In many non-English speaking countries (and projects with
ridiculous managers/code standards), other prefixes are used and
proper BeanInfo implementations are supplied. Although it is not
pretty at all, since they are following the JavaBean spec, I don't
think Bean Validation shouldn't work out-of-the-box for them;
Emmanuel
I reused the Java Persistence wording actually and I explicitly reference
the Introspector class. Do people think we should be more cautious here?
Speaking for France, I've never seen a project bothering about get/is/set
and BeanInfo. People happily used frenglish: getCafeAuLait()
Actually I've never seen anybody from the server side bothering about
BeanInfos ;)
Michael
I've got an interesting case for that one: in some JVM languages,
another standard is used to represent properties. Let's take, for
instance, Scala.
In Scala, one could write a bean like:
@BeanInfo
class Person(var id : Long, var name : String, var surname : String)
Scala already maps vars as properties creating a private var, a public
getter method named like the var and a setter like var_=. Something
like:
private var _id : Long
def id = _id
def id_=(newId: Long) = _id = newId
that would translate to Java methods id and id_$eq (since = cannot be
used in method names). So, when one use @BeanInfo, a proper BeanInfo
subclass is generated by the compiler providing that mapping.
Given how popular JVM languages are getting, not following a spec in
another one and causing property support in those languages to fail to
work doesn't seem nice.
BTW, please let the JPA EG know about his as well.
--
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
15 years, 9 months