[Hibernate-JIRA] Created: (HHH-7152) Can't use annotations to map nested Embeddables where the inner instance has a ManyToOne reference
by Chris L (JIRA)
Can't use annotations to map nested Embeddables where the inner instance has a ManyToOne reference
--------------------------------------------------------------------------------------------------
Key: HHH-7152
URL: https://hibernate.onjira.com/browse/HHH-7152
Project: Hibernate ORM
Issue Type: Bug
Components: annotations
Affects Versions: 3.5.5
Environment: Hibernate 3.5.5, any database.
Reporter: Chris L
Attachments: NestedEmbeddableBug.zip
Using annotations, we set up an Entity containing an ElementCollection, whose elements themselves contain an Embeddable, which has a ManyToOne reference to another Entity. When we use this set up to build the SessionFactory, it fails with an ArrayIndexOutOfBoundsException in the AbstractCollectionPersister.
Exception is below, source code files are attached: Run View.main() to reproduce the issue.
{{Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:1736)
at org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:1712)
at org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:600)
at org.hibernate.persister.collection.BasicCollectionPersister.<init>(BasicCollectionPersister.java:74)
at org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:104)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:318)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at com.rtrms.hibernate.View.main(View.java:46)}}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (HSEARCH-998) Unlock at startup using SimpleFSLockFactory
by David Polo (JIRA)
Unlock at startup using SimpleFSLockFactory
-------------------------------------------
Key: HSEARCH-998
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-998
Project: Hibernate Search
Issue Type: Bug
Components: massindexer
Affects Versions: 4.0.0.CR2
Environment: Java 1.6, Hibernate Search 4.0.0.CR2 on Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bits
Reporter: David Polo
I'm using SimpleFSLockFactory and I'm getting this exception after an unexpected shutdown of the application during indexation:
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out
The workaround consists in executing this code at startup in order to unlock the indexes:
FullTextSession fullTextSession = Search.getFullTextSession(hbSession);
MutableSearchFactory searchFactory = (MutableSearchFactory) fullTextSession
.getSearchFactory();
IndexReader indexReader = fullTextSession.getSearchFactory()
.getIndexReaderAccessor().open("");
Map<Class<?>, EntityIndexBinder> indexBindingsForEntity = searchFactory
.getIndexBindingForEntity();
for (EntityIndexBinder eib : indexBindingsForEntity.values()) {
IndexManager[] indexManagers = eib.getIndexManagers();
DirectoryBasedIndexManager indexManager = (DirectoryBasedIndexManager) indexManagers[0];
Directory indexDirectory = indexManager.getDirectoryProvider()
.getDirectory();
if (IndexWriter.isLocked(indexDirectory)) {
IndexWriter.unlock(indexDirectory);
}
}
I have a single application that executes this code at startup so I think it's safe to unlock the Directory at this time.
I'm doing this because I'm using SimpleFSLockFactory and it leaves write.lock files.
I need to unlock at startup because I think using NativeFSLockFactory is not an option for me (I'm using NFS).
It will be a good thing if Hibernate Search have an "unlock at startup" option. It could be used only in cases like this (not all cases!).
In Solr there is an option:
<unlockOnStartup>true</unlockOnStartup>
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-5927) Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan
by Strong Liu (JIRA)
Performance risk: Suboptimal synchronization in org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan
---------------------------------------------------------------------------------------------------------
Key: HHH-5927
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5927
Project: Hibernate Core
Issue Type: Improvement
Components: core
Reporter: Strong Liu
Attachments: hotspot.png
with Order Demo (real-life simulation attempt test app) I have noticed that there is thread contention on createNamesQuery() which sounds suspicious.
After investigation it boils down to org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan. It serves as a cache (internal, not replacable) for queries using LRU algorithm (supplied from Apache utils).
Generally speaking, blocking threads in any sort of caches indicates a problem. From about 2000 calls, 700 got blocked (which is also not nice for context switching).
I guess, one of the problems is that there is exclusive synchronization in get method:
public synchronized Object get(Object key) {...}
which could be replaced by a more granular read-write lock.
org/hibernate/engine/query/QueryPlanCache.java
org/hibernate/util/SoftLimitMRUCache.java
--
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
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-6983) remove common-collections dependency
by Strong Liu (JIRA)
remove common-collections dependency
------------------------------------
Key: HHH-6983
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6983
Project: Hibernate ORM
Issue Type: Improvement
Components: core
Reporter: Strong Liu
Assignee: Strong Liu
dhcp-14-237:hibernate-core stliu$ find . -name "*.java" | xargs grep "import org.apache.commons.collections"
./hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java:import org.apache.commons.collections.map.AbstractReferenceMap;
./hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java:import org.apache.commons.collections.map.ReferenceMap;
./hibernate-core/src/main/java/org/hibernate/internal/util/collections/SimpleMRUCache.java:import org.apache.commons.collections.map.LRUMap;
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (OGM-124) Errors while startin Infinispan are hidden by a NPE stacktrace
by Sanne Grinovero (JIRA)
Errors while startin Infinispan are hidden by a NPE stacktrace
--------------------------------------------------------------
Key: OGM-124
URL: https://hibernate.onjira.com/browse/OGM-124
Project: Hibernate OGM
Issue Type: Bug
Components: datastore
Reporter: Sanne Grinovero
Assignee: Sanne Grinovero
Priority: Minor
Fix For: 4.0-next
When Infinispan boots up incorrectly it seems we log a NPE instead of the original reason, which is a bit misleading:
{quote}
Caused by: org.hibernate.MappingException: Could not instantiate persister org.hibernate.ogm.persister.OgmEntityPersister
at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:169)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:131)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:346)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
... 47 more
Caused by: java.lang.NullPointerException
at org.hibernate.ogm.datastore.infinispan.impl.InfinispanDatastoreProvider.putInLocalCache(InfinispanDatastoreProvider.java:129)
at org.hibernate.ogm.datastore.infinispan.impl.InfinispanDatastoreProvider.eagerlyInitializeCaches(InfinispanDatastoreProvider.java:123)
at org.hibernate.ogm.datastore.infinispan.impl.InfinispanDatastoreProvider.start(InfinispanDatastoreProvider.java:108)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.startService(AbstractServiceRegistryImpl.java:255)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:162)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.ogm.datastore.impl.DatastoreServicesImpl.configure(DatastoreServicesImpl.java:53)
at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.ogm.persister.OgmEntityPersister.<init>(OgmEntityPersister.java:116)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:158)
... 52 more
{quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months