[Hibernate-JIRA] Created: (HV-526) Bug in Hibernate Validator ? Stackoverflow on @Required
by Vincent LE HELLIDU (JIRA)
Bug in Hibernate Validator ? Stackoverflow on @Required
-------------------------------------------------------
Key: HV-526
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-526
Project: Hibernate Validator
Issue Type: Bug
Components: annotation-processor, engine, validators
Affects Versions: 4.2.0.Final, 4.1.0.Final
Environment: Tests done on Hibernate 3.6.5 final and Hibernate 3.6.7 final with MySQL 5.1
Reporter: Vincent LE HELLIDU
Attachments: HibernateTest.zip
Hello,
I have a stackoverflow error in the following test case.
This test case define a bidirectionnal relation OneToMany between A and B where at least one B is Required in the collection A.getB().
The goal of the test case is to delete some B retreived from database.
My conclusion: it does not work when retreiving B directly - see deleteFromB() - but it works when getting B from the retreived A - see deleteFromA().
In class MainAB.java, if I use deleteFromA() method, the deletion of "B"s works but deleteFromB() causes a stackoverflow.
I think it is a bug on Hibernate or Hibernate Validator but I am not sure, perhaps it is normal with this mapping ?
If someone can guide me.
Best regards,
Vincent
ORIGINAL POST : https://forum.hibernate.org/viewtopic.php?f=9&t=1012855
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[Hibernate-JIRA] Created: (HSEARCH-960) Index.UN_TOKENIZED overrides other tokenized fields that share the same name
by John-Michael Au (JIRA)
Index.UN_TOKENIZED overrides other tokenized fields that share the same name
----------------------------------------------------------------------------
Key: HSEARCH-960
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-960
Project: Hibernate Search
Issue Type: Bug
Components: mapping
Affects Versions: 3.4.0.Final
Environment: 3.4.0 Final
Reporter: John-Michael Au
Marking one field as un-tokenized causes all other fields with the same names to be un-tokenized.
i.e.
@Field(name = "simple_search", index = Index.UN_TOKENIZED, store = Store.NO)
private String string;
@Field(name = "simple_search", index = Index.TOKENIZED, store = Store.NO)
private String string2;
The resulting behaviour is that "simple_search" will be made up of un-tokenized 'string' and 'string2' values, even though 'string2' was specified to be tokenized.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[Hibernate-JIRA] Created: (HHH-3160) Support one-to-many list associations with constraints on both (owner_id, position) and (child_id)
by Gail Badner (JIRA)
Support one-to-many list associations with constraints on both (owner_id, position) and (child_id)
--------------------------------------------------------------------------------------------------
Key: HHH-3160
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3160
Project: Hibernate3
Issue Type: Sub-task
Reporter: Gail Badner
Assignee: Gail Badner
The logic used for removing entities from one-to-many list associations can cause ConstraintViolationException will be thrown if there are constraints on both (owner_id, position) and (child_id) in the "collection table". If the association is on a join table, the "collection table" is the join table; otherwise, the "collection table" is the child entity table..
Currently, SchemaExport does not put a constraint on (owner_id, position) when exporting one-to-many list associations on a foreign key. SchemaExport should be updated to also export this constraint.
See HHH-1268 for a description of how to reproduce this issue.
For one-to-many list associations on a foreign key, the workaround is to either define the constraint on (owner_id, position) in the child entity table as deferred. If this is not on option for a particular Dialect, the constraint on (owner_id, position) will have to be excluded.
For a one-to-many list association on a join table, the workaround is to either define the constraint on (child_id) in the join table as deferred. If this is not on option for a particular Dialect, the constraint on (child_id) will have to be excluded.
--
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, 5 months
[Hibernate-JIRA] Created: (HHH-6425) On Sybase ASE, insert a empty string '' to db, it stores it as single space ' '
by Ren Junyan (JIRA)
On Sybase ASE, insert a empty string '' to db, it stores it as single space ' '
-------------------------------------------------------------------------------
Key: HHH-6425
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6425
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.0
Environment: Hibernate 3.6.6, Sybase ASE15.5, JDK 1.6, Windows XP
Reporter: Ren Junyan
This is a defect of ASE, it fails the test below.
testNewSerializableType(org.hibernate.test.lob.SerializableTypeTest)
org.hibernate.type.SerializationException: could not deserialize
at org.hibernate.util.SerializationHelper.doDeserialize(SerializationHelper.java:250)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:306)
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:130)
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:116)
at org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:39)
at org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:62)
at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:249)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:229)
at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:330)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2283)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
at org.hibernate.loader.Loader.getRow(Loader.java:1355)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
at org.hibernate.loader.Loader.doQuery(Loader.java:829)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3293)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
at org.hibernate.test.lob.SerializableTypeTest.testNewSerializableType(SerializableTypeTest.java:82)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2280)
at java.io.ObjectInputStream$BlockDataInputStream.readUnsignedShort(ObjectInputStream.java:2761)
at java.io.ObjectInputStream$BlockDataInputStream.readUTF(ObjectInputStream.java:2819)
at java.io.ObjectInputStream.readString(ObjectInputStream.java:1598)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1319)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at org.hibernate.util.SerializationHelper.doDeserialize(SerializationHelper.java:244)
... 60 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months
[Hibernate-JIRA] Created: (HSEARCH-961) ObjectNotFoundException not caught in FullTextSession for deleted objects
by Anders Soee (JIRA)
ObjectNotFoundException not caught in FullTextSession for deleted objects
-------------------------------------------------------------------------
Key: HSEARCH-961
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-961
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.4.1.Final
Environment: Hibernate 3.6.7
EHCache 1.2.4 and 2.4.6 in Read-write mode.
MS SQL Server 2000
async indexing.
Reporter: Anders Soee
Priority: Minor
Experienced behavior:
1: Show page with search results.
2: Delete one
3: Redirect back to the previous search.
4: Sometimes (about 1 in 10), the search fails with an ObjecNotFoundException.
Expected behavior:
As experienced, minus the exceptions.
My analysis:
Since the indexing is asynchronous, there will be a short period, where the search will include the deleted item.
If the entities where not cached, this should not be a problem, since they would simply not be included in the IN query.
In this case, however, all the entities are cached by EHCache in read-write mode.
I have identified the problem to be in SecondLevelCacheObjectsInitializer:
65: final boolean isIn2LCache = session.getSessionFactory().getCache().containsEntity( entityInfo.getClazz(), entityInfo.getId() );
66: if ( isIn2LCache ) {
67: //load the object from the second level cache
68: session.get( entityInfo.getClazz(), entityInfo.getId() );
69: }
Line 68 is where the exception occurs.
It appears that cache.containsEntity() is not a guarantee that the entity can actually be loaded.
In fact, in EHCache a lock object is placed in the cache when the item is deleted, and never removed again.
Thus the cache contains "something", just not a loadable entity.
My suggestion:
Wrap session.get() with a try-catch block, and ignore ObjectNotFoundException's (and probably EntityNotFoundException too, for JPA).
My workaround:
Manually evicting the entity from the 2nd level cache when deleting it.
Stacktrace:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.jysk.resmgr.model.Resource#5663]
at org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:435)
at org.hibernate.event.def.DefaultLoadEventListener.returnNarrowedProxy(DefaultLoadEventListener.java:320)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:277)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)
at org.hibernate.search.query.hibernate.impl.SecondLevelCacheObjectsInitializer.initializeObjects(SecondLevelCacheObjectsInitializer.java:68)
at org.hibernate.search.query.hibernate.impl.PersistenceContextObjectsInitializer.initializeObjects(PersistenceContextObjectsInitializer.java:81)
at org.hibernate.search.query.hibernate.impl.MultiClassesQueryLoader.executeLoad(MultiClassesQueryLoader.java:135)
at org.hibernate.search.query.hibernate.impl.AbstractLoader.load(AbstractLoader.java:72)
at org.hibernate.search.query.hibernate.impl.FullTextQueryImpl.list(FullTextQueryImpl.java:208)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 5 months