[Hibernate-JIRA] Created: (HHH-5168) DB2Dialect generates CROSS JOINs which aren't supported
by Grzegorz Olędzki (JIRA)
DB2Dialect generates CROSS JOINs which aren't supported
-------------------------------------------------------
Key: HHH-5168
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5168
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.0-Final
Environment: Hibernate 3.5.0-Final, using hibernate-jpa-2.0-api-1.0.0.Final.jar, DB2/NT SQL09013
Reporter: Grzegorz Olędzki
When executing a simple JPQL query:
{code}
SELECT st FROM ScheduledTask st WHERE (NOT st.status = 'COMPLETED') AND st.active = TRUE AND st.task.group = :group
{code}
Hibernate generates the following SQL query:
{code}
select scheduledt0_.QSID as col_0_0_
from SCHSCHEDTASK_QS scheduledt0_ cross join SCHTASK_QT task1_
where scheduledt0_.QTID=task1_.QTID and scheduledt0_.QSSTATUS<>'COMPLETED' and scheduledt0_.QSACTIVE=1 and task1_.QTGROUP=?
{code}
which crashes with:
{code}
2010-04-28 10:14:18,551 WARN [org.hibernate.util.JDBCExceptionReporter]/[org.hibernate.util.JDBCExceptionReporter]
SQL Error: -104, SQLState: 42601
2010-04-28 10:14:18,552 ERROR [org.hibernate.util.JDBCExceptionReporter]/[org.hibernate.util.JDBCExceptionReporter]
DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: cross;TASK_QS scheduledt0_;<space>
2010-04-28 10:14:18,552 WARN [org.hibernate.util.JDBCExceptionReporter]/[org.hibernate.util.JDBCExceptionReporter]
SQL Error: -727, SQLState: 56098
2010-04-28 10:14:18,553 ERROR [org.hibernate.util.JDBCExceptionReporter]/[org.hibernate.util.JDBCExceptionReporter]
DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;cross|TASK_QS scheduledt0_|<space>
2010-04-28 10:14:18,554 WARN [org.hibernate.util.JDBCExceptionReporter]/[org.hibernate.util.JDBCExceptionReporter]
SQL Error: -727, SQLState: 56098
2010-04-28 10:14:18,554 ERROR [org.hibernate.util.JDBCExceptionReporter]/[org.hibernate.util.JDBCExceptionReporter]
DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;cross|TASK_QS scheduledt0_|<space>
{code}
The very same JPQL query works on MySQL database (the actual SQL query uses CROSS JOIN too).
When trying to run the same SQL on DB2 manually in a database client the error message is the same (-104, 42601).
A subtle change in the query, i.e. replacing CROSS JOIN with a comma (,) seems to fix the problem - both manually and using Hibernate-based application.
Using the following DB2Dialect seems to help:
{code}
public class DB2Dialect extends org.hibernate.dialect.DB2Dialect {
@Override
public String getCrossJoinSeparator() {
return ", ";
}
}
{code}
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-5490) dirty data be inserted into 2L cache
by Strong Liu (JIRA)
dirty data be inserted into 2L cache
-------------------------------------
Key: HHH-5490
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5490
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.6.0.Beta3, 3.5.5
Reporter: Strong Liu
{code}
public void testInsertWithRefresh() {
getSessions().getCache().evictEntityRegions();
getSessions().getStatistics().clear();
Session s = openSession();
s.beginTransaction();
Item item = new Item();
item.setName("stliu");
s.save(item);
s.flush();
s.refresh(item);
s.getTransaction().rollback();
s.close();
Map cacheMap = getSessions().getStatistics()
.getSecondLevelCacheStatistics("item").getEntries();
assertEquals(0, cacheMap.size());
s = openSession();
s.beginTransaction();
item = (Item)s.get(Item.class, item.getId());
s.getTransaction().commit();
s.close();
assertNull("it should be null", item);
}
{code}
see above test case, since the insertion is rollbacked, so, there is no that row in the DB, but you can see the null assertion will fail due to the dirty data be inserted into the 2l cache after refresh operation.
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-4074) Polymorphic queries avoid with polymorphism="explicit" in hbm.xml file doesn't work
by Radics Laszlo (JIRA)
Polymorphic queries avoid with polymorphism="explicit" in hbm.xml file doesn't work
-----------------------------------------------------------------------------------
Key: HHH-4074
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4074
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Environment: hibernate 3.3.2
Oracle 9i
Reporter: Radics Laszlo
hbm.xml:
<hibernate-mapping default-cascade="none">
<class name="hu.raiffeisen.aps.soa.entity.collateral.AncestorImpl" table="ANCESTOR" dynamic-insert="false" dynamic-update="false" polymorphism="explicit">
<id name="id" type="java.lang.Long" unsaved-value="null">
<column name="ID" sql-type="NUMBER(19)"/>
<generator class="sequence">
<param name="sequence">ANCESTOR_SEQ</param>
</generator>
</id>
<property name="top" type="java.lang.Long">
<column name="TOP" not-null="true" unique="false" sql-type="NUMBER(19)"/>
</property>
<union-subclass name="hu.raiffeisen.aps.soa.entity.collateral.DescendantImpl" table="DESCENDANT" dynamic-insert="false" dynamic-update="false" abstract="false">
<property name="bottom" type="java.lang.Long">
<column name="BOTTOM" not-null="true" unique="false" sql-type="NUMBER(19)"/>
</property>
</union-subclass>
</class>
</hibernate-mapping>
hql: "from AncestorImpl" fetch both ancestor and descendant rows
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-4042) StatelessSession does not flush when using jdbc batch_size > 1
by Gael Beaudoin (JIRA)
StatelessSession does not flush when using jdbc batch_size > 1
--------------------------------------------------------------
Key: HHH-4042
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4042
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: JBoss 4.2.3, Linux, java 1.6, hibernate 3.3.1, entityManager 3.4.0, jboss seam 2.1.2, postgresql 8.3
Reporter: Gael Beaudoin
I'm using a StetelessSession to insert millions of rows : it works great and without using much memory. But I've just seen that with a jdbc batch size of 50 for example (<property name="hibernate.jdbc.batch_size" value="0"/> in my persistence.xml) the last round of inserts aren't flushed to the database. For example, with 70 insert, only the first 50 are sent to the database.
I've searched a lot about this issues and on this thread (https://forum.hibernate.org/viewtopic.php?f=1&t=987882&start=0), the only solution found is to set the batch_size to 1, which is really a shame.
I've tried to flush the session, close the jdbc connection, etc etc ... no luck.
I'd be fine with a way to set the batch_size to 1 only for this method, pro grammatically, but I've not found any way to do that.
If you don't pay attention, it's a easy way to lose data.
--
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, 2 months