[Hibernate-JIRA] Created: (HHH-2445) Wrong data type used for MySQL timestampdiff(FRAC_SECOND, date1, date2)
by Don Smith (JIRA)
Wrong data type used for MySQL timestampdiff(FRAC_SECOND, date1, date2)
-----------------------------------------------------------------------
Key: HHH-2445
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2445
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.2.0.ga
Environment: MySQL 5.0.27, Connector/J 5.0.4, SUSE Linux Enterprise Desktop 10
Reporter: Don Smith
The following HQL
List results = executeQuery("select timestampdiff(FRAC_SECOND, startDate, endDate) from IntervalTracker order by id");
throws this stack trace:
org.hibernate.exception.DataException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2092)
at org.hibernate.loader.Loader.list(Loader.java:2087)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.novell.soa.persist.HibernateDateDiffTest.executeQuery(HibernateDateDiffTest.java:152)
at com.novell.soa.persist.HibernateDateDiffTest.testDateDiff(HibernateDateDiffTest.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: com.mysql.jdbc.exceptions.MySQLDataException: '3605940000000' in column '1' is outside valid range for the datatype INTEGER.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:893)
at com.mysql.jdbc.ResultSet.throwRangeException(ResultSet.java:7391)
at com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3967)
at com.mysql.jdbc.ResultSet.getNativeInt(ResultSet.java:3892)
at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2555)
at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2570)
at org.hibernate.type.IntegerType.get(IntegerType.java:28)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:161)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:150)
at org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow(QueryLoader.java:333)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:594)
at org.hibernate.loader.Loader.doQuery(Loader.java:689)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2208)
... 38 more
--
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
19 years, 1 month
[Hibernate-JIRA] Created: (HBX-906) Support better readable results when toString isn't implemented for "select new SomeObject(p1, p2, p3)" statements
by Joseph Marques (JIRA)
Support better readable results when toString isn't implemented for "select new SomeObject(p1, p2, p3)" statements
------------------------------------------------------------------------------------------------------------------
Key: HBX-906
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-906
Project: Hibernate Tools
Type: New Feature
Versions: 3.2beta8
Reporter: Joseph Marques
If I have some class called SomeObject WITHOUT a toString method, and I have some statement like "select new SomeObject(p1, p2, p3)", the results look like
0
SomeObject@19cd8ea
SomeObject@65168f
SomeObject@ac1d0e
SomeObject@1a79e4
SomeObject@9cd89b
SomeObject@11c00d8
...
Instead, why not attempt to show the results as:
0 1 2
<p1.toString()> <p2.toString()> <p3.toString()>
<p1.toString()> <p2.toString()> <p3.toString()>
<p1.toString()> <p2.toString()> <p3.toString()>
In other words, statements like "select new SomeObject(p1, p2, p3) ..." should default to the same results that "select p1, p2, p3 ..." would.
Thoughts?
--
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
19 years, 1 month
[Hibernate-JIRA] Created: (HHH-2451) HQL: selecting subselects within subselects doesn't work
by Jay Merrifield (JIRA)
HQL: selecting subselects within subselects doesn't work
--------------------------------------------------------
Key: HHH-2451
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2451
Project: Hibernate3
Type: Bug
Components: core, query-hql
Versions: 3.2.2
Reporter: Jay Merrifield
This is similar to the bug in HHH-2284. Instead this time I have the following HQL query:
select eb from EarlyBird as eb, Topic as t where eb.id = t.criteriaLinks_.documents_.id and t = ?
where Topic contains
<set access="field" name="criteriaLinks_" table="TopicCriteria" lazy="true" inverse="true">
<key column="topicId" />
<many-to-many column="criteriaLinkId" class="org.illumen.oasdpa.CriteriaLink" />
</set>
and CriteriaLink contains
<set access="field" name="documents_" table="CriteriaDocument" lazy="true" inverse="false">
<key column="criteriaLinkId"/>
<many-to-many column="documentId" class="org.illumen.document.Document"/>
</set>
This works under 3.0. But it's failing with the error:
2007-02-26 17:27:02,775 DEBUG [DotNode] getDataType() : documents_ -> org.hibernate.type.IdentifierBagType(org.illumen.oasdpa.CriteriaLink.documents_)
org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:555)
2007-02-26 17:27:02,775 ERROR [PARSER] illegal syntax near collection: documents_
org.hibernate.hql.ast.ErrorCounter.reportError(ErrorCounter.java:33)
2007-02-26 17:27:02,790 DEBUG [ErrorCounter] illegal syntax near collection: documents_
org.hibernate.hql.ast.ErrorCounter.reportError(ErrorCounter.java:28)
illegal syntax near collection: documents_
at org.hibernate.hql.ast.tree.DotNode.checkLhsIsNotCollection(DotNode.java:500)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:205)
at org.hibernate.hql.ast.tree.DotNode.resolveFirstChild(DotNode.java:143)
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:460)
--
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
19 years, 1 month
jdbc.batch_size qs
by S DALAL
Hi,
I have two queries with regard to jdbc.batch_size parameter,
1. How to get the actual cause of exception when jdbc.batch_size > 0 ,
because it throws a generic exception saying batch has failed ?
2. What are the consequences if it is set to 0 ?
regards
dalal
19 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1296) Non lazy loaded List updates done in wrong order, cause exception
by Christian Bauer (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296?page=c... ]
Christian Bauer commented on HHH-1296:
--------------------------------------
Failing test case (preferably from the Hibernate test suite)? Patch?
> Non lazy loaded List updates done in wrong order, cause exception
> -----------------------------------------------------------------
>
> Key: HHH-1296
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.0.5
> Environment: Hibernate 3.0.5 - any database (checked postgres 7/8, mysql 4 & 5, db2 v8)
> NOT using lazy loading - the tx's are wrapped by session beans, so lazy loading is not allowed.
> Reporter: David Birch
> Priority: Critical
>
>
> The logic behind list updates is not quite right, nor was it in v2 (only now i have a DBA who won't let up...)
> The scenario is:
> a bean with list property, and the list has a number of items in it (say 4, index 0-3), an item is then removed (say item at index 2), and the bean is requested to be saved.
> From what i can see in the SQL traces, the same statements are issues whe lazy loading is on or off, they are:
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: delete from TGE_CLIENT_POLICY where CLIENT_ID=? and POSITION=?
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: update TGE_CLIENT_POLICY set POLICY_NK=? where CLIENT_ID=? and POSITION=?
> So, i can only assume (as when this fails, the row with index 1 above the removed row is nuked!), hibernate removes the item at index 3, and then copies the value of the item at index 3 onto the row for item at index 2. Fair enough but...
> When i have lazy loading off, i get DB exceptions like
> Duplicate key or integrity constraint violation message from server: "Duplicate entry '1-999999' for key 1"
> so, there is some nasty in there, which is not updating the correct row - this has happened since 2.1.8 that i know of :(
> i will try & look @ the source, but won't get a chance until after xmas...
--
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
19 years, 1 month
[Hibernate-JIRA] Commented: (HHH-1296) Non lazy loaded List updates done in wrong order, cause exception
by Andrej Golovnin (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296?page=c... ]
Andrej Golovnin commented on HHH-1296:
--------------------------------------
Could someone bump the priority to "Blocker"? This issue is really annoying and must be fixed in the next release.
> Non lazy loaded List updates done in wrong order, cause exception
> -----------------------------------------------------------------
>
> Key: HHH-1296
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1296
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.0.5
> Environment: Hibernate 3.0.5 - any database (checked postgres 7/8, mysql 4 & 5, db2 v8)
> NOT using lazy loading - the tx's are wrapped by session beans, so lazy loading is not allowed.
> Reporter: David Birch
> Priority: Critical
>
>
> The logic behind list updates is not quite right, nor was it in v2 (only now i have a DBA who won't let up...)
> The scenario is:
> a bean with list property, and the list has a number of items in it (say 4, index 0-3), an item is then removed (say item at index 2), and the bean is requested to be saved.
> From what i can see in the SQL traces, the same statements are issues whe lazy loading is on or off, they are:
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: delete from TGE_CLIENT_POLICY where CLIENT_ID=? and POSITION=?
> [18/12/05 19:48:50:766 EST] 00000036 SystemOut O Hibernate: update TGE_CLIENT_POLICY set POLICY_NK=? where CLIENT_ID=? and POSITION=?
> So, i can only assume (as when this fails, the row with index 1 above the removed row is nuked!), hibernate removes the item at index 3, and then copies the value of the item at index 3 onto the row for item at index 2. Fair enough but...
> When i have lazy loading off, i get DB exceptions like
> Duplicate key or integrity constraint violation message from server: "Duplicate entry '1-999999' for key 1"
> so, there is some nasty in there, which is not updating the correct row - this has happened since 2.1.8 that i know of :(
> i will try & look @ the source, but won't get a chance until after xmas...
--
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
19 years, 1 month
[Hibernate-JIRA] Created: (HBX-903) Better error-handling when executing jpql/hql statements
by Joseph Marques (JIRA)
Better error-handling when executing jpql/hql statements
--------------------------------------------------------
Key: HBX-903
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-903
Project: Hibernate Tools
Type: New Feature
Versions: 3.2beta8
Reporter: Joseph Marques
i was written a query that used composite objects, such as:
select new Thing(elt1, elt2) from .....
and the class Thing had the following toString implementation:
public class Thing {
...
public Stirng toString() {
return elt1.toString + ", " + elt2.toString();
}
...
}
Most of the time elt2 has a valid value, but occassionally the model will return a valid result where elt2 is null. Obviously, this is going to make the toString implementation bomb with a NullPointerException - but I received one error for EVERY SINGLE RESULT ITEM that has null in it. So, when I was querying several hundred objects, I basically just sat on the return key (to accept the error msg boxes that popped up) until several dozen of them were acknowledged.
I think it would be more intuitive to aggregate the exceptions by thrown location and type, and then insert into the error log something like "Problems occured when invoking code from plug-in: 'org.eclipse.jface' (56 times)" and then only notify me with a single pop-up error msg box - instead of 56 errors in the log and 56 modal msg boxes that I have to accept before I can continue.
--
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
19 years, 1 month
[Hibernate-JIRA] Commented: (HHH-952) Patch to allow subqueries with joins using Criteria API and Subqueries with DetachedCriteria
by Pierre (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-952?page=co... ]
Pierre commented on HHH-952:
----------------------------
As this been fixed? I used the patch and it worked fine for me, it would be nice to see the patch integrated
> Patch to allow subqueries with joins using Criteria API and Subqueries with DetachedCriteria
> --------------------------------------------------------------------------------------------
>
> Key: HHH-952
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-952
> Project: Hibernate3
> Type: Patch
> Components: core
> Versions: 3.1 beta 1, 3.1 beta 2
> Environment: 3.1beta1 with MS SQL 2000 via jTDS
> Reporter: John
> Priority: Critical
> Attachments: SubqueryExpression.java, subquery-patch-311.txt, subquery-patch-313.txt, subquery-patch-31beta3.txt, subquery-patch.txt, subquery-patch.txt
>
>
> The existing code in SubqueryExpression.java constructed a select statement but did not have any provisions for creating joins. Therefore, it was not possible using the criteria API to create an exists subselect that had a join, even though running the source DetachedCriteria alone works perfectly.
> For example, if this is the goal:
> select * from foo f
> where exists (select id from bar b join other o on b.o_id = o.id where o.prop = '123' and b.foo_id = f.id)
> One might try something like this:
> Criteria crit = session.createCriteria(Foo.class, fooAlias);
> DetachedCriteria barCrit = DetachedCriteria.forClass(Bar.class, barAlias);
> DetachedCriteria otherCrit = barCrit.createCriteria(Bar.OTHER_JOIN);
> otherCrit.add( Restrictions.eq(Other.PROP, "123") );
> barCrit.add( Restrictions.eqProperty( -- props to join to foo here --) );
> barCrit.setProjection( Projections.id() );
> crit.add( Subqueries.exists(barCrit) );
> However, the existing code generates something like the following, which gets an error with an unknown alias 'o':
> select * from foo f
> where exists (select id from bar b where o.prop = '123' and b.foo_id = f.id)
> This is also described here (at the end): http://forum.hibernate.org/viewtopic.php?t=942488
> The patch to SubqueryExpression.java fixes this to included the joins necessary for the filtering. This code was modeled (copied) off of code from CriteriaLoader. For me this works perfectly, but I don't understand the internals of this stuff enough to say how robust it is. Also included is a patch to the test case to enable testing of this, which was present but commented out. I did not change the contents of the test, which currently only attempts a joined subquery. This used to fail with an error, but now it works. The test does not check the results at all. (Inconsequential to the patch - Enrollment has two Ls.)
> -----side notes
> The patch file also has two other patches. The first increases the delay in BulkManipulationTest because I was getting inconsistent test results. I think that the precision on the version timestamp is not enough for 300 milliseconds delay to be enough to guarantee the test results. Also, in build.xml, there was a line that was meant to exclude the performance tests, but there was no **/*, on *, so they actually were not excluded. I changed this so the tests would complete in a reasonable amount of time. However, there is one other issue with testing that I worked around manually. After each test run, two databases (Users and Email) were left in the database. If I did not manually delete these then the number of failures on the next test run was different. This was really confusing until I figured it out because I was trying to make sure all the other testcases still passed with my patch, but even without the patch I was getting different results.
--
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
19 years, 1 month