[Hibernate-JIRA] Commented: (HHH-1804) Empty 'FetchingScrollableResultsImpl' throws SQLException
by Andreas Sahlbach (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804?page=c... ]
Andreas Sahlbach commented on HHH-1804:
---------------------------------------
Could someone PLEASE fix this bug? It's now nearly 4 years old, there is a test case and a patch that seems to work and it is still _very_ annoying. The only workaround is to catch the exception and parse the message to distinguish it from other exceptions. It really sucks to be forced to use such a workaround. And the patch is not very complicated...
> Empty 'FetchingScrollableResultsImpl' throws SQLException
> ---------------------------------------------------------
>
> Key: HHH-1804
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804
> Project: Hibernate Core
> Issue Type: Bug
> Reporter: Maarten Winkels
> Attachments: EmptyFetchJoinScrollTest.java, scroll-join-fetch-empty.patch
>
>
> When scrolling a HQL query with join fetch on a collection, that doesn't return any results, the following execption occurs:
> org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:386)
> at org.hibernate.impl.FetchingScrollableResultsImpl.next(FetchingScrollableResultsImpl.java:55)
> at org.hibernate.test.joinfetch.EmptyFetchJoinScrollTest.testFetchJoinEmptyScroll(EmptyFetchJoinScrollTest.java:21)
> 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:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:161)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.sql.SQLException: No data is available
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.checkAvailable(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getColumnInType(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hibernate.type.StringType.get(StringType.java:18)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
> at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:375)
> ... 18 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
14 years, 11 months
[Hibernate-JIRA] Created: (HSEARCH-385) Lazy ManyToOne association with @containedIn annotation cause HSearch create entity index with documentId = 0
by Grégoire Rolland (JIRA)
Lazy ManyToOne association with @containedIn annotation cause HSearch create entity index with documentId = 0
-------------------------------------------------------------------------------------------------------------
Key: HSEARCH-385
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-385
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA, 3.1.0.GA
Environment: Hibernate 3.3.1.GA, Postgresql 8.3
Reporter: Grégoire Rolland
Priority: Critical
Attachments: hsearch.tar.gz
In a transaction, create Entity1 associated to one Entity2 (E1->E2 lazy oneToMany, E2->E1 lazy manyToOne).
In antoher transaction, find Entity2, modify Entity2.
On commit, I get this log :
2009-07-02 11:42:18,791 TRACE [org.hibernate.search.backend.impl.lucene.works.DeleteExtWorkDelegate] - Removing class org.foo.hibernate.search.jira.Entity1#0 by id using an IndexWriter.
2009-07-02 11:42:18,792 TRACE [org.hibernate.search.backend.impl.lucene.works.AddWorkDelegate] - add to Lucene index: class org.foo.hibernate.search.jira.Entity1#0:Document<stored/uncompressed,indexed<_hibernate_class:org.foo.hibernate.search.jira.Entity1> stored/uncompressed,indexed<uid:0> stored/uncompressed,indexed<entities2.uid:224136060>>
in the index :
1 document for Entity, with the correct Id, and 1 document with Id = 0, index is corrupted.
See the test case for more info.
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-5075) Storing @NotAudit column in _AUD tables
by Stephanie Pau (JIRA)
Storing @NotAudit column in _AUD tables
----------------------------------------
Key: HHH-5075
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5075
Project: Hibernate Core
Issue Type: Bug
Components: envers
Reporter: Stephanie Pau
Priority: Minor
When @Audited is not applied to a property, the property change does not trigger an audited row to be recorded. This is desirable. But at the same time, this property is missing from the audited table altogether. Is there a way for me to tell Enver to keep the column but just dont trigger an audit on this property change?
For example, ObjectOne has properties: id, column1(@audited), column2(not audited).
When column1 changes, audit row is created for ObjectOne will be id, REV, column1, *column2*
When column2 changes, audit row is not created.
The reason for this is because column1 is business critical field, every change is important. column2 is a much faster changing field than column1, but is not that business critical, none the less, it is still useful to have a rough (sampled at the rate of column1 change) history of column2.
http://community.jboss.org/message/535808#535808
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-5076) Multiple failures reported during ReadOnlyProxyTest with Ingres
by Ray Fan (JIRA)
Multiple failures reported during ReadOnlyProxyTest with Ingres
---------------------------------------------------------------
Key: HHH-5076
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5076
Project: Hibernate Core
Issue Type: Patch
Components: testsuite
Affects Versions: 3.5.0-Final
Environment: Hibernate 3.5.0-Final, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Priority: Minor
Attachments: DataPoint.hbm.xml.svn.diff
Failures reported from org.hibernate.test.readonly.ReadOnlyProxyTest in the following tests:
{noformat}
testReadOnlyViaSessionDoesNotInit
testReadOnlyViaLazyInitializerDoesNotInit
testReadOnlyViaSessionNoChangeAfterInit
testReadOnlyViaLazyInitializerNoChangeAfterInit
testReadOnlyViaSessionBeforeInit
testModifiableViaSessionBeforeInit
testReadOnlyViaSessionBeforeInitByModifiableQuery
testReadOnlyViaSessionBeforeInitByReadOnlyQuery
testModifiableViaSessionBeforeInitByModifiableQuery
testModifiableViaSessionBeforeInitByReadOnlyQuery
testReadOnlyViaLazyInitializerBeforeInit
testModifiableViaLazyInitializerBeforeInit
testReadOnlyViaLazyInitializerAfterInit
testModifiableViaLazyInitializerAfterInit
testReadOnlyChangedEvictedUpdate
testReadOnlyToModifiableInitWhenModifiedIsUpdated
testReadOnlyInitToModifiableModifiedIsUpdated
testReadOnlyModifiedUpdate
testReadOnlyProxyMergeDetachedProxyWithChange
testReadOnlyProxyInitMergeDetachedProxyWithChange
testReadOnlyProxyMergeDetachedEntityWithChange
testReadOnlyProxyInitMergeDetachedEntityWithChange
testReadOnlyEntityMergeDetachedProxyWithChange
testSetReadOnlyInTwoTransactionsSameSession
testSetReadOnlyBetweenTwoTransactionsSameSession
testSetModifiableBetweenTwoTransactionsSameSession
{noformat}
All fail because of an assertion expected:<0.1000000000000000055> but was:<0.10000000000000000550> when run with Ingres 9.3.
The DataPoint.hbm.xml description for X and Y specify precision 25 and scale 20 creating the equivalent decimal(25,20) in the Ingres table and returning a zero padded decimal value.
Adjusted the scale in the mapping to match expected.
--
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, 11 months
[Hibernate-JIRA] Created: (HSEARCH-495) IdentifierProducer: ClassCastException
by Marco Pirruccio (JIRA)
IdentifierProducer: ClassCastException
--------------------------------------
Key: HSEARCH-495
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-495
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.2.0.Beta1
Environment: hibernate-core-3.5.0-Beta-2.jar, hibernate-commons-annotations-3.2.0.Beta1.jar, hibernate-search-3.2.0.Beta1.jar, jtds-1.2.5.jar (SQL Server 2008), Java 6
Reporter: Marco Pirruccio
Priority: Blocker
Executing the following code:
FullTextSession s = Search.getFullTextSession(session);
MassIndexer mi = s.createIndexer();
mi.optimizeOnFinish(true);
mi.batchSizeToLoadObjects(10);
mi.startAndWait();
I obtain the following exception:
Exception in thread "Hibernate Search: identifierloader-1" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
at org.hibernate.search.batchindexing.IdentifierProducer.loadAllIdentifiers(IdentifierProducer.java:114)
at org.hibernate.search.batchindexing.IdentifierProducer.inTransactionWrapper(IdentifierProducer.java:103)
at org.hibernate.search.batchindexing.IdentifierProducer.run(IdentifierProducer.java:91)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The executed query is:
select
count(this_.idfornitore) as y0_
from
fornitore this_
The method loadAllIdentifiers() does the following cast:
Long totalCount = (Long) session
.createCriteria( indexedType )
.setProjection( Projections.count( "id" ) )
.setCacheable( false )
.uniqueResult();
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-5074) Criteria query using AliasToBeanResultTransformer fails with 3.5-Final
by Florian Grote (JIRA)
Criteria query using AliasToBeanResultTransformer fails with 3.5-Final
----------------------------------------------------------------------
Key: HHH-5074
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5074
Project: Hibernate Core
Issue Type: Bug
Components: core, query-criteria, query-sql
Affects Versions: 3.5.0-Final
Environment: Hibernate 3.5-Final,
Database: MySQL 5.1.45 GA,
JDBC: mysql-connector-java-5.1.12
Reporter: Florian Grote
I use the following Criteria query to receive the top ten users for an attribute "scoreSum". Attribute "statistic" is an embedded child (@Embeddable) of "User" entity.
The result is written directly into a value object using AliasToBeanResultTransformer.
{code:title=Criteria query|borderStyle=solid}
@SuppressWarnings("unchecked")
@Override
public List<TopUserVO> getTopUsersAsVO(int max) {
return getCurrentSession().createCriteria(User.class)
.setProjection(Projections.projectionList()
.add( Projections.property("username"), "username" )
.add( Projections.property("statistic.scoreSum"), "scores" )
)
.addOrder(Property.forName("statistic.scoreSum").desc())
.setMaxResults(max)
.setResultTransformer( new AliasToBeanResultTransformer(TopUserVO.class) )
.list();
}
{code}
Until inclusive Hibernate version 3.5-CR2 this runs fine and results in the valid (My-)SQL query:
{quote}
select
this_.USERNAME as y0_,
this_.SCORE_SUM as y1_
from USER this_
order by this_.SCORE_SUM desc limit ?
{quote}
After upgrading to Hibernate version 3.5-final the same query fails because SQL query is not created correctly anymore. Corrupted SQL:
{quote}
select
{color:red}*y0_ as y0_,*{color}
this_.SCORE_SUM as y1_
from USER this_
order by this_.SCORE_SUM desc
{quote}
Problem is that "y0_" is used twice, instead of using it only as alias: "this_.USERNAME as y0_".
Here is the relevant part of the root stacktrace:
{code:title=Root Exception}
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'y0_' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2264)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1849)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.doList(Loader.java:2294)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
at org.hibernate.loader.Loader.list(Loader.java:2167)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at xyz.dao.UserDaoImpl.getTopUsersAsVO(UserDaoImpl.java:95)
{code}
I will try to research the new Hibernate code and the difference to the old one and try to provide a patch.
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-4784) JDBCTransaction -> commit() -> notifyLocalSynchsBeforeTransactionCompletion()
by Silvan Eugen Lincan (JIRA)
JDBCTransaction -> commit() -> notifyLocalSynchsBeforeTransactionCompletion()
-----------------------------------------------------------------------------
Key: HHH-4784
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4784
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-2
Environment: hibernate-distribution-3.5.0-Beta-2
ms-sqlserver 2008
Reporter: Silvan Eugen Lincan
Java class: org.hibernate.transaction.JDBCTransaction
method: commit()
line: 140 call to notifyLocalSynchsBeforeTransactionCompletion()
The problem is this: method notifyLocalSynchsBeforeTransactionCompletion(), it swallows any exception that may occur at this level and permits the execution flow of commit() method to continue.
But in this case, the hibernate session may be already corrupted, so the commit will be wrong.
In my opinion, the method notifyLocalSynchsBeforeTransactionCompletion() should throw the exception, and on line 140 in commit() method, the call to this notifyLocalSynchsBeforeTransactionCompletion() should be surrounded also in the try{}catch(){}.
Otherwise, any error that can occur on Synchronization, will be omitted and the transaction committed(it should be rolled back).
I had this problem, executing the tests from envers module with the ms sqlserver 2008 database.
The test org.hibernate.envers.test.integration.reventity.ExceptionListener crashes.
I hope that it deserves your attention.
Thank you very much.
--
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, 11 months