[Hibernate-JIRA] Created: (HHH-5803) ValueHandlerFactory fails to convert from java.lang.Long to java.lang.Number
by Jens Rydholm (JIRA)
ValueHandlerFactory fails to convert from java.lang.Long to java.lang.Number
----------------------------------------------------------------------------
Key: HHH-5803
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5803
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager, query-criteria
Affects Versions: 3.6.0
Environment: Hibernate 3.6.0, Microsoft SQL Server 2008 R2
Reporter: Jens Rydholm
When using the criteria builder to compare the quotient between two database columns with a Long value from the Java code, Hibernate is unaware of how to convert from a Long to a Number (despite Long being a subclass of Number). Pseudocode and exception stacktrace included below.
CriteriaBuilder builder = ...;
Path<Long> longPath = ...;
Path<Float> floatPath = ...;
Long aLong = 250000000L;
builder.ge(builder.quot(longPath, floatPath), aLong);
java.lang.IllegalArgumentException: Unaware how to convert value [250000000 : java.lang.Long] to requested type [java.lang.Number]
at org.hibernate.ejb.criteria.ValueHandlerFactory.unknownConversion(ValueHandlerFactory.java:259)
at org.hibernate.ejb.criteria.ValueHandlerFactory.convert(ValueHandlerFactory.java:287)
at org.hibernate.ejb.criteria.predicate.ComparisonPredicate.<init>(ComparisonPredicate.java:88)
at org.hibernate.ejb.criteria.CriteriaBuilderImpl.ge(CriteriaBuilderImpl.java:534)
...
Can be worked around by using builder.toLong to wrap builder.quot, like this:
builder.ge(builder.toLong(builder.quot(longPath, floatPath)), aLong);
Due to time constraints and the existing workaround, a test case can unfortunately not be provided at this time.
--
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
13 years, 2 months
[Hibernate-JIRA] Created: (HSEARCH-689) MassIndexer throwing LazyInitializationException on associated collections
by Bayo Erinle (JIRA)
MassIndexer throwing LazyInitializationException on associated collections
--------------------------------------------------------------------------
Key: HSEARCH-689
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-689
Project: Hibernate Search
Issue Type: Bug
Components: massindexer
Affects Versions: 3.3.0.Final
Environment: Hibernate 3.6.0.Final
Oracle Database 11g Release 11.1.0.0.0 - Production and HSQLDB 1.8.0
Unix/Windows XP
Reporter: Bayo Erinle
Priority: Blocker
Attachments: hs_forum_poc.zip
The root element I am indexing LegacyCarPlant has a reference to LegacyCar, which in turn embeds a collection of LegacyTire.
When I kick off the indexer, I always get a LazyInitializationException on the collections.
(PS: See stack trace at the tail end)
If I make them eager, then the issue goes away, but ideally, I don't want to fetch them eagerly. I'll much rather prefer they remain lazily fetched for obvious reasons.
The alternative is to crawl through in a loop and index using fullTextSession.index(T), but that is really really slow as I have upwards of 3million records and still growing.
I have read the forums and tried all the suggestions I have seen including trying to run it on a single thread like
fullTextSession.createIndexer(LegacyCarPlant.class)
.batchSizeToLoadObjects(30)
.threadsForSubsequentFetching(1)
.threadsToLoadObjects(1)
to no avail.
Also, I have tried with the snapshot of 3.4.0 and the same error exists.
If I do make the root element LegacyPlant, then I don't get the error as well. In my situation though, I need to have LegacyCarPlant be the root.
The test program is "legacy_index_run.groovy"
Stack Trace:
04:34:30 DEBUG SQL.logStatement - select count(*) as y0_ from Z_LEG_CAR_PLANT this_
04:34:30 INFO SimpleIndexingProgressMonitor.addToTotalCount - Going to reindex 1 entities
04:34:30 DEBUG SQL.logStatement - select this_.CAR_ID as y0_, this_.PLANT_ID as y1_ from Z_LEG_CAR_PLANT this_
04:34:30 DEBUG SQL.logStatement - select this_.CAR_ID as CAR1_2_1_, this_.PLANT_ID as PLANT2_2_1_, this_.PLANT_NAME as PLANT3_2_1_, legacycar2_.CAR_ID as CAR1_0_0_, legacycar2_.MODEL as MODEL0_0_ from Z_LEG_CAR_PLANT this_ left outer join Z_LEG_CAR legacycar2_ on this_.CAR_ID=legacycar2_.CAR_ID where (this_.CAR_ID, this_.PLANT_ID) in ((?, ?))
04:34:30 ERROR LazyInitializationException.<init> - failed to lazily initialize a collection of role: com.jrock.forum.LegacyCar.tires, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.jrock.forum.LegacyCar.tires, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:186)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:457)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:481)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.getDocument(DocumentBuilderIndexedEntity.java:379)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.createAddWork(DocumentBuilderIndexedEntity.java:317)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.index(EntityConsumerLuceneworkProducer.java:155)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.indexAllQueue(EntityConsumerLuceneworkProducer.java:123)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.run(EntityConsumerLuceneworkProducer.java:96)
at org.hibernate.search.batchindexing.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:107)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
04:34:30 ERROR EntityConsumerLuceneworkProducer.run - error during batch indexing:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.jrock.forum.LegacyCar.tires, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:186)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:457)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:481)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.getDocument(DocumentBuilderIndexedEntity.java:379)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.createAddWork(DocumentBuilderIndexedEntity.java:317)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.index(EntityConsumerLuceneworkProducer.java:155)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.indexAllQueue(EntityConsumerLuceneworkProducer.java:123)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.run(EntityConsumerLuceneworkProducer.java:96)
at org.hibernate.search.batchindexing.OptionallyWrapInJTATransaction.run(OptionallyWrapInJTATransaction.java:107)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
04:34:30 INFO SimpleIndexingProgressMonitor.indexingCompleted - Reindexed 1 entities
done indexing! Total time taken: 893 ms
--
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
13 years, 2 months
[Hibernate-JIRA] Created: (HHH-5960) New repository of JBoss is not properly configured
by Max Bourinov (JIRA)
New repository of JBoss is not properly configured
--------------------------------------------------
Key: HHH-5960
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5960
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.0.Beta3, 3.5.5, 3.6.0.Beta2, 3.6.0.Beta1, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0-Final, 3.5.0-CR-2, 3.5.0-CR-1, 3.5.0-Beta-4, 3.5.0-Beta-3, 3.5.0-Beta-2, 3.5.0.Beta-1, 3.3.2, 3.3.1, 3.3.0.SP1, 3.3.0.GA, 3.3.0.CR2, 3.3.0.CR1, 3.2.7, 3.2.6, 3.2.5, 3.2.4.sp1, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.2.0.cr5, 3.2.0.cr4, 3.2.0.cr3, 3.2.0.cr2, 3.2.0 cr1, 3.1.3, 3.2.0.alpha2, 3.2.0.alpha1, 3.1.2, 3.1.1, 3.1, 3.1 rc3, 3.1 rc2, 3.1 rc 1, 3.1 beta 2, 3.1 beta 1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0 final, 3.0 rc 1, 3.0 beta 4, 3.0 beta 3, 3.0 beta 2, 3.0 beta 1, 3.0 alpha, 3.6.2, 3.6.next, 3.x, 4.0.0.Alpha1, 4.0.0.Alpha2, 4.0.0.Alpha3, entity-modes, hql+collection, antlr-rework, 4.x
Reporter: Max Bourinov
Priority: Blocker
New repository of JBoss is not properly configured.
If I go to browse repository index (not logged it), for example:
http://repository.jboss.org/nexus/content/groups/public/org/hibernate/hib...
I see latest release 3.6.1.Final - this is absolutelly correct.
But via Nexus interface I see only the following:
https://repository.jboss.org/nexus/index.html#nexus-search;gav~org.hibern...
As you can see no artifacts from local repository is presented. Only remote artifacts are shown.
Moreover, if I setup my nexus to proxy JBoss' nexus, my nexus obtains only corrupted data (all files has json extension and jar are not there.)
Please, reconfigure your nexus to make community able to proxy it properly.
--
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
13 years, 2 months
[Hibernate-JIRA] Updated: (HHH-1268) Unidirection OneToMany causes duplicate key entry violation when removing from list
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268?page=c... ]
Steve Ebersole updated HHH-1268:
--------------------------------
Fix Version/s: (was: 3.6.next)
3.6.3
> Unidirection OneToMany causes duplicate key entry violation when removing from list
> -----------------------------------------------------------------------------------
>
> Key: HHH-1268
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1, 3.5.6, 3.6.0
> Environment: 3.1 final
> MySql 4.1.14 using MYISAM tables
> Reporter: Rex Madden
> Assignee: Gail Badner
> Fix For: 3.2.x, 3.3.x, 3.6.3, 4.0.0.Alpha3
>
> Attachments: possible_solution.patch, src.zip
>
>
> Simple OneToMany parent/child relationship using the default table structure (2 tables and a join table)
> Add 3 children to the parent. Flush. Remove the first child. Flush throws error:
> Exception in thread "main" 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:143)
> 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 UnidirectionalOneToManyRemoveFromListBug.main(UnidirectionalOneToManyRemoveFromListBug.java:27)
> 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:86)
> Caused by: java.sql.BatchUpdateException: Duplicate key or integrity constraint violation, message from server: "Duplicate entry '5' for key 2"
> at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1461)
> at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
> at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
> ... 11 more
> The problem is that there is a unique key on the relationship table that gets violated. The session removes the last row in the relationship table, then attempts to rewrite the child_id's. It fails since there is a uniqueness constraint on that column.
--
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
13 years, 2 months