[Hibernate-JIRA] Created: (HSEARCH-822) SearchFactoryState should use concurrent Maps for incrementally updated metadata
by Sanne Grinovero (JIRA)
SearchFactoryState should use concurrent Maps for incrementally updated metadata
--------------------------------------------------------------------------------
Key: HSEARCH-822
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-822
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.4.0.Final
Reporter: Sanne Grinovero
Assignee: Sanne Grinovero
Fix For: 4.0.0.Alpha1
I've experienced very sporadic failures of MutableFactoryTest, when trying again it won't be reproduced.
The Workspace goes in NPE on the single-line method
{code}org.hibernate.search.backend.Workspace.getDocumentBuilder(Class<T>){code}
So it seems it's receiving work for a new entity type while the document builder of it was not "deployed" yet.
Indeed these DocumentBuilders are stored in a non-concurrent HashMap, replacing the implementation with a CHM it's now running the tests in a loop without reporting the exception anymore.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (HSEARCH-824) Run in parallel some of the engine initialization
by Emmanuel Bernard (JIRA)
Run in parallel some of the engine initialization
-------------------------------------------------
Key: HSEARCH-824
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-824
Project: Hibernate Search
Issue Type: Improvement
Reporter: Emmanuel Bernard
In IndexManagerHolder.buildEntityIndexBinding we currently synchronize. But the critical part is only between
indexManagersRegistry.get( providerName )
indexManagersRegistry.put( providerName, indexManager )
Even that does a lot of work.
We could parallelize the creation of EntityIndexBinder:
* synchronize this small piece described above
* move indexManager.initialize out of the sync block and be executed by ServiceFactoryBuilder#initDocumentBuilders (the caller of IndexManagerHolder.buildEntityIndexBinding)
* in ServiceFactoryBuilder#initDocumentBuilders run the various phases in parallel with a ExecutorService (ie build EntityindexBinder, initialize IndexManagers, build DocumentBuilder etc)
If class > 10 - number to refine, split the work.
This can be done by a community member but it's not a trivial task
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[Hibernate-JIRA] Created: (ANN-758) map key type no longer inferred correctly, throws exception at runtime
by David Mansfield (JIRA)
map key type no longer inferred correctly, throws exception at runtime
----------------------------------------------------------------------
Key: ANN-758
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-758
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.3.1.GA
Environment: hib. 3.2, annotaions 3.3.1GA, em 3.3.1GA, oracle 10r2, tomcat 5.5, linux, spring 2.0
Reporter: David Mansfield
Attachments: hib-anno-set-map-key-type.patch
after upgrading from annotations 3.3.0GA to 3.3.1GA, my mapped collection (ManyToMany) is broken. i've identified the commit that broke it:
http://fisheye.jboss.com/browse/Hibernate/annotations/trunk/src/java/org/...
The issue is that unless the type is given now expliticly in the @MapKey's @Type, the code now assumes a 'Serializable' type, and attempts to deserialize an object stream from the database column value. the exact exception is:
java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:252)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:209)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)
at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)
at org.hibernate.type.SerializableType.get(SerializableType.java:39)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
...
The fix is simple: if @Type is NOT given in the @MapKey annotation, keep the old behavior which at least tries to set the type, even if it may not work in all situations. The attached patch fixes the problem for me.
In my particular situation, the map key type is a java.lang.Enum. Here's what my annotated property looks like:
@ManyToMany
@JoinTable(
name="chargeback_owner"
,joinColumns=@JoinColumn(name="person_id",referencedColumnName="person_id")
,inverseJoinColumns=@JoinColumn(name="owner_person_id")
)
@MapKey(columns=@Column(name="owner_type_cd"),targetElement=ChargebackOwnerType.class)
@Enumerated(EnumType.STRING)
@Sort(type=SortType.NATURAL)
private SortedMap<ChargebackOwnerType,Person> owners = new TreeMap<ChargebackOwnerType, Person>();
--
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, 8 months