[Hibernate-JIRA] Created: (HHH-3187) Issue with Hibernate3.0 and weblogic8.1 while setting transaction is marked to setRollbackOnly... (AppSetRollbackOnlyException)
by Anjan Deb (JIRA)
Issue with Hibernate3.0 and weblogic8.1 while setting transaction is marked to setRollbackOnly... (AppSetRollbackOnlyException)
-------------------------------------------------------------------------------------------------------------------------------
Key: HHH-3187
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3187
Project: Hibernate3
Issue Type: Task
Affects Versions: 3.0 final
Environment: hibernate3.0, weblogic8.1, oracle9.1
Reporter: Anjan Deb
I am using Hibernate 3.0 with JTA (Weblogic 8.1 SP4).
Basically, I am trying to handle transaction/hibernate exceptions in my application.
I am managing transactions with UserTransaction. I start a transaction at the begining of the request and after that I am doing some operations on that transaction. And if some exception comes I log it, rollback the transaction and throw the exception.
UserTransaction.commit() throws RollbackException if anything goes wrong with the operation, but, it does not return what exactly went wrong, like, exceptions related to SQL Exception or hibernate Exception. It basically dumps all that information to the logs internally and throws RollbackException with the following trace (see below). But this trace has no such information which I can send back to the user. As, information of what went wrong has already been dumped to the server console.
I will appreciate if you can tell if there is anyway I can recieve the actual exception trace or am I doing anything wrong with the hibernate configuration??
Thanks in Advance,
Anjan
------------------------------------------------------------------------------------------------------------------------------
Actual Exception which transaction dumps to the server console/log
ERROR - ORA-00001: unique constraint (NOVATXN.UQ_BROKERS) violated
ERROR - ORA-00001: unique constraint (NOVATXN.UQ_BROKERS) violated
ERROR - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:69)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (NOVATXN.UQ_BROKERS) violated
at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8726)
at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:169)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
... 27 more
RollbackException Trace:
03/17/2008 08:50:09 [EROR] JTATransactionalAction weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
03/17/2008 08:50:09 [EROR] JTATransactionalAction com.novarum.nova.application.OperationException: Transaction does not exist
03/17/2008 08:50:09 [DBUG] MessageProcessor Unknown reason
java.lang.RuntimeException: Unknown reason
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:54)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: com.novarum.nova.application.OperationException: Unknown reason
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:35)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
... 10 more
Caused by: weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
... 11 more
getCause(): com.novarum.nova.application.OperationException: Unknown reason
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:35)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
... 11 more
getCause(): weblogic.transaction.internal.AppSetRollbackOnlyException
at weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:504)
at org.hibernate.transaction.CacheSynchronization.setRollbackOnly(CacheSynchronization.java:73)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:63)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Unknown reason - with nested exception:
[weblogic.transaction.internal.AppSetRollbackOnlyException]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
getNested(): weblogic.transaction.internal.AppSetRollbackOnlyException
at weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:504)
at org.hibernate.transaction.CacheSynchronization.setRollbackOnly(CacheSynchronization.java:73)
at org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:63)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1216)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1990)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:246)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:303)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:296)
at com.ebw.nova.common.invoker.JTATransactionalAction.commit(JTATransactionalAction.java:31)
at com.ebw.nova.common.invoker.TransactionalAction.doAction(TransactionalAction.java:47)
at com.ebw.nova.common.invoker.ActionInvoker.invokeAction(ActionInvoker.java:21)
at com.ebw.nova.server.handler.AbstractRequestHandler.process(AbstractRequestHandler.java:73)
at com.ebw.nova.server.communication.jms.MessageProcessor.processRequest(MessageProcessor.java:44)
at com.ebw.ejb.mdb.MQManager.onMessage(MQManager.java:70)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Following is the hibernate.cfg.xml
<session-factory>
<!-- properties -->
<property name="connection.datasource">jdbc/novaJDBCDataSource</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="current_session_context_class">jta</property>
<property name="show_sql">false</property>
<property name="format_sql">true</property>
<property name="hibernate.default_schema">novatxn</property>
<property name="jdbc.batch_size">30</property>
<!-- jdbc.batch_versioned_data is set to false, making it true hibernate doesn't raise optimistic exception. -->
<property name="jdbc.batch_versioned_data">false</property>
<property name="jdbc.use_streams_for_binary">true</property>
<!-- Outer join fetching is used in MultiDArray-->
<property name="max_fetch_depth">1</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<!--property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property-->
<!--#Using the Hibernate 2.1 query parser, because of Weblogic 8.1 ANTLR issue.-->
<property name="query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
</session-factory>
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-2917) arithmatic of subselect throws NPE
by John Aylward (JIRA)
arithmatic of subselect throws NPE
----------------------------------
Key: HHH-2917
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2917
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5
Annotation 3.3.0
VAlidator 3.0.0
MySQL 5.0.44
Reporter: John Aylward
Exception Stack:
java.lang.NullPointerException
at org.hibernate.hql.ast.tree.BinaryArithmeticOperatorNode.getRightHandOperand(BinaryArithmeticOperatorNode.java:185)
at org.hibernate.hql.ast.tree.BinaryArithmeticOperatorNode.initialize(BinaryArithmeticOperatorNode.java:20)
at org.hibernate.hql.ast.HqlSqlWalker.prepareArithmeticOperator(HqlSqlWalker.java:1011)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.arithmeticExpr(HqlSqlBaseWalker.java:2729)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1278)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4041)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3600)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1762)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1690)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1687)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
HQL:
[SELECT DISTINCT pi.billingAccount.consolidatedBillingAccount.bankAccount FROM com.cicat.bedrock.billing.model.ProviderInvoice AS pi WHERE pi.readyForPayment=true AND (SELECT piad.total FROM com.cicat.bedrock.billing.model.ProviderInvoiceAccountData AS piad WHERE piad.invoice = pi AND piad.providerBillingAccount = pi.billingAccount) > ((SELECT COALESCE(SUM(amount),0) FROM com.cicat.bedrock.billing.model.BankAccountTransaction AS bat1 WHERE bat1.deleted=false AND bat1.providerInvoice = pi) + (SELECT COALESCE(SUM(amount),0) FROM com.cicat.bedrock.billing.model.BankAccountTransactionSplit AS bats1 WHERE bats1.deleted=false AND bats1.bankAccountTransaction.deleted=false AND bats1.providerInvoice = pi)) ]
Representative SQL of HQL call:
SELECT DISTINCT ba.* from ProviderInvoice AS pi
INNER JOIN ProviderBillingAccount AS pba ON pi.billingAccount_id=pba.id
INNER JOIN ConsolidatedBillingAccount AS cba ON pba.consolidatedBillingAccount_id=cba.id
INNER JOIN BankAccount AS ba ON cba.bankAccount_id=ba.id
WHERE
pi.readyForPayment=true AND
(SELECT piad.total FROM ProviderInvoiceAccountData AS piad WHERE piad.invoice_id = pi.id AND piad.providerBillingAccount_id = pi.billingAccount_id)
>
((SELECT COALESCE(SUM(bat1.amount),0) FROM BankAccountTransaction AS bat1 WHERE bat1.deleted=false AND bat1.providerInvoice_id = pi.id)
+
(SELECT COALESCE(SUM(bats1.amount),0) FROM BankAccountTransactionSplit AS bats1 INNER JOIN BankAccountTransaction bat2 ON bats1.bankAccountTransaction_id=bat2.id WHERE bats1.deleted=false AND bat2.deleted=false AND bats1.providerInvoice_id = pi.id))
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HBX-849) Tools does not insert @Type in POJOs for user types defined in reveng.xml
by Zeljko Trogrlic (JIRA)
Tools does not insert @Type in POJOs for user types defined in reveng.xml
-------------------------------------------------------------------------
Key: HBX-849
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-849
Project: Hibernate Tools
Type: Bug
Components: hbm2java, reverse-engineer
Environment: jboss-seam-1.1.0.GA, MySQL
Reporter: Zeljko Trogrlic
I have created reveng.xml file:
<hibernate-reverse-engineering>
<table
catalog="configuration"
name="userdb_domain_acl">
<column name="enabled" type="com.siemens.msm.model.mapping.BooleanEnumType" exclude="false"/>
</table>
</hibernate-reverse-engineering>
and included it in build.xml:
<jdbcconfiguration propertyfile="build.properties"
packagename="${model.package}"
revengfile="${project.home}/reveng.xml"/>
Generated POJO attribute has proper type, but user type information is missing:
@Column(name = "enabled")
@Length(max = 42)
public Boolean getEnabled() {
....
so Hibernate reports error:
3:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl
13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain]
13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui
javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar(
2)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Annotations should look like this:
@Column(name = "enabled")
@Type(type="booleanEnum")
public Boolean getEnabled() {
...
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-3227) Oracle's connect by syntax is mishandled when used with Filter
by Kyrill Alyoshin (JIRA)
Oracle's connect by syntax is mishandled when used with Filter
--------------------------------------------------------------
Key: HHH-3227
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3227
Project: Hibernate3
Issue Type: Bug
Components: query-sql
Affects Versions: 3.2.5
Environment: Hibernaet 3.2.5.GA, Oracle 10g.
Reporter: Kyrill Alyoshin
Basically, I have a filter definition on a class (via annotation), here it is:
@Filter(name = "limitInvoicesByAccountHolderHierarchy",
condition = "CHRG_ACCT_ID in (" +
"select ca1.chrg_acct_id from cv_chrg_acct ca1 " +
"inner join cv_org_unit og1 on ca1.acct_hldr_id = og1.org_unit_id " +
"where og1.org_unit_id in (" +
"select og2.org_unit_id from cv_org_unit og2 " +
"start with og2.org_unit_id = :root " +
" connect by prior og2.org_unit_id = og2.hier_par_org_unit_id" +
')' +
')'
It contains Oracle's "connect by" clause. Here is the SQL statement that Hibernate generates when trying to query invoices with the filter enabled:
Hibernate:
/*
from
Invoice */ select
invoice0_.inv_id as inv1_31_,
......
from
CV_INV invoice0_
where
invoice0_.CHRG_ACCT_ID in (
select
ca1.chrg_acct_id
from
cv_chrg_acct ca1
inner join
cv_org_unit og1
on ca1.acct_hldr_id = og1.org_unit_id
where
og1.org_unit_id in (
select
og2.org_unit_id
from
cv_org_unit og2 invoice0_.start invoice0_.with og2.org_unit_id = ? invoice0_.connect
by
invoice0_.prior og2.org_unit_id = og2.hier_par_org_unit_id
)
)
Even though the documentation states that the condition of the filter is pure SQL (which is great!), it still does not pass SQL verbatim but is actually trying to pre-process the following words: start, with, connect, prior.
Is there an easy work around to make Oracle10gDialect recognize these words?
Thanks a lot for looking into this!
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-2402) HQL generates inner join when selecting a specific attribute that is linked to another entity
by Peter Mutsaers (JIRA)
HQL generates inner join when selecting a specific attribute that is linked to another entity
---------------------------------------------------------------------------------------------
Key: HHH-2402
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2402
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.2
Environment: Oracle 9i, affects ONLY version 3.2.2, was still working OK in version 3.2.1 and before.
Reporter: Peter Mutsaers
Priority: Critical
Mapping (note the lazy='false', it is essential to cause the problem):
<class name='Currency' lazy='false'>
....
</class>
<class name='Asset'>
<id name='id' ... </id>
<many-to-one name='currency' class='Currency' fetch='select'/>
</class>
The following HQL query: "select a.id, a.currency from Asset a"
used to generate a query on the Asset table, and subsequently generates separate queries on the Currency table.
Since version 3.2.2, this generates an inner join on Asset with Currency.
Now many Assets may have a NULL currency, so we do not get all records anymore!
This breaks logic and queries all over the place for us.
We can't go back to 3.2.1 due to other bugs that had been solved in 3.2.2.
The query "from Asset a" still works OK and as before, i.e. it makes the select only on the Asset table and afterwards fetches the Currency with individual selects.
I fear that an optimization has been made that has this negative side effect.
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-3510) Sybase - Timestamp not being translated to the built-in database function
by Juraci Paixao Krohling (JIRA)
Sybase - Timestamp not being translated to the built-in database function
-------------------------------------------------------------------------
Key: HHH-3510
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3510
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: Branch_3_2_4_SP1_CP and Sybase 15
Reporter: Juraci Paixao Krohling
Test Case: ComponentTest#testComponentQueries
Hibernate query "from Employee e where e.person = ('steve', current_timestamp)" should have translated "current_timestamp" to "getdate()" [1]:
14:49:11,087 DEBUG SQL:424 - select employee0_.ID as ID1_, employee0_.HIRE_DATE as HIRE2_1_, employee0_.name as name1_, employee0_.dob as dob1_, employee0_.value1 as value5_1_, employee0_.value2 as value6_1_ from T_EMP employee0_ where employee0_.name='steve' and employee0_.dob=current_timestamp
14:49:11,535 WARN JDBCExceptionReporter:77 - SQL Error: 207, SQLState: ZZZZZ
14:49:11,536 ERROR JDBCExceptionReporter:78 - Invalid column name 'current_timestamp'.
[1] SybaseDialect, line 58: registerFunction( "current_timestamp", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-3018) Configuration element to tell Hibernate to have just one insert to flush an entity and not both an insert and an update.
by Nicolas Cazottes (JIRA)
Configuration element to tell Hibernate to have just one insert to flush an entity and not both an insert and an update.
------------------------------------------------------------------------------------------------------------------------
Key: HHH-3018
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3018
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.5
Reporter: Nicolas Cazottes
Attachments: testXMLTypeUpdates.zip
While analyzing the SQL queries Hibernate generates to persist objects, I fall on a behaviour, that I first found strange, which is that in one flush of one transaction, there may be both an insert and an update for a given entity. My first expectation was to have only one insert and no update.
After a few search, I discover that conversation (http://forum.hibernate.org/viewtopic.php?p=2191664&sid=c571096bda4a6b636e...) that explains it is normal in the case of a save with modifications after save.
I discover (cf the classes of my zip showing it) that this behaviour is also present in the case of a relation that is managed by cascade. What I noticed is that the insert of the related entity is planned when the first hql query is executed after the relation has been established. So if the related entity is modified after the query execution (for exemple depending on the result of the query), an update will be executed.
This behaviour is understandable but in my case, the update is really expensive (because it acts on an XMLType column) and unless I set a FlushMode to COMMIT (which I found really not a good solution), I can not control that Hibernate will generate both an insert and an update or only an insert. I know I could also set the relation just before the commit in order to avoid insert+update but this solution is not possible in my case and I find it not elegant (it would break the semantic of the cascade of the relation).
I suggest to introduce a new configuration element (similar to the flushmode) in Hibernate in order to be able to have control whether Hibernate generates an insert containing the data of the entity at the first save or an insert containing the data of the entity at the flushing time.
Note : The attached files (which is the smallest extraction of what does my application) shows that behaviour both for the save call and the cascade declenched by a query.
Note2 : I found an issue in jira number 2621 submited by someone else that is related to this subject in think.
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-2426) Misleading logging messages when using ThreadLocalSessionContext
by Don Smith (JIRA)
Misleading logging messages when using ThreadLocalSessionContext
----------------------------------------------------------------
Key: HHH-2426
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2426
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.ga
Reporter: Don Smith
Priority: Minor
The log messages printed out by TransactionFactoryFactory and SettingsFactory are misleading when using ThreadLocalSessionContext:
2007-02-09 21:49:58,581 INFO [org.hibernate.transaction.TransactionFactoryFactory:info] Using default transaction strategy (direct JDBC transactions)
2007-02-09 21:49:58,588 INFO [org.hibernate.transaction.TransactionManagerLookupFactory:info] No TransactionManagerLookup Configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2007-02-09 21:49:58,590 INFO [org.hibernate.cfg.SettingsFactory:info] Automatic flush during beforeCompletion(): disabled
2007-02-09 21:49:58,591 INFO [org.hibernate.cfg.SettingsFactory:info] Automatic session close at end of transaction: disabled
This does not indicate that sessions will be closed after commit, which is the behavior when using ThreadLocalSessionContext.
--
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
14 years, 3 months