[Hibernate-JIRA] Created: (HHH-4938) Multiple errors reported during legacy FooBarTest with Ingres
by Ray Fan (JIRA)
Multiple errors reported during legacy FooBarTest with Ingres
-------------------------------------------------------------
Key: HHH-4938
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4938
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-4
Environment: 3.5.0-Beta-4, Ingres 9.3.1
Reporter: Ray Fan
Attachments: IngresAmbiguousColumnTest.java, legacy.zip
During test org.hibernate.test.legacy.FooBarTest multiple tests fail with ambiguous column defined in the select list.
{noformat}
<error message="could not initialize a collection: [org.hibernate.test.legacy.Abstract.abstracts#ff80808126e244920126e246eeb10001]" type="org.hibernate.exception.GenericJDBCException">org.hibernate.exception.GenericJDBCException: could not initialize a collection: [org.hibernate.test.legacy.Abstract.abstracts#ff80808126e244920126e246eeb10001]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:132)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:120)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.loadCollection(Loader.java:2048)
at org.hibernate.loader.collection.BatchingCollectionInitializer.initialize(BatchingCollectionInitializer.java:86)
at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:628)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1853)
at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:476)
at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:899)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:276)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1907)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3212)
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:1080)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:997)
at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:386)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:234)
at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:84)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdateCopy(SessionImpl.java:914)
at org.hibernate.impl.SessionImpl.saveOrUpdateCopy(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.saveOrUpdateCopy(SessionImpl.java:882)
at org.hibernate.test.legacy.FooBarTest.testSaveOrUpdateCopyAny(FooBarTest.java:126)
Caused by: com.ingres.gcf.util.SqlEx: line 1, Column 'str' found in more than one FROM list table.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
{noformat}
The generate SQL query select list contains multiple columns named 'str'.
--
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
15 years, 5 months
[Hibernate-JIRA] Created: (HHH-5089) not-null integrity must be checked for DML statements and not for objects
by Markus Bohr (JIRA)
not-null integrity must be checked for DML statements and not for objects
-------------------------------------------------------------------------
Key: HHH-5089
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5089
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Windows XP
Eclipse 3.5.1
Teneo 1.0.3
Reporter: Markus Bohr
This issue somehow relates to HHH-4057 but is of much broader scope and pointing out a different aspect.
Currently Hibernate checks the not-null constraint integrity persisting any object already on the object level (which is a quite early point in time; for loading objects, this might cause analoguous problems).
The not-null XML attribute, however, is part of the <column> tag and therefore is assumed to match the characteristics of a column and not a mapped object property!
I am facing severe problems with the current behaviour, as the not-null check is performed even before
any nullSafePut() method is executed for a customized Hibernate type, or even before any the any PreInsertEventListener / PreUpdateEventListener has a chance to transform null-values for properties to non-null values for database columns.
Effectively, the flexibility to handle different nullability characteristics between columns and their mapped properties is thus reduced to zero.
--
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
15 years, 5 months
[Hibernate-JIRA] Created: (HSEARCH-386) In a Transaction, Delete on unindexed entities referenced by indexed entities with ContainedIn throw LazyInitializationException
by Grégoire Rolland (JIRA)
In a Transaction, Delete on unindexed entities referenced by indexed entities with ContainedIn throw LazyInitializationException
--------------------------------------------------------------------------------------------------------------------------------
Key: HSEARCH-386
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-386
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
Delete on unindexed entities referenced by indexed entities with ContainedIn annotation failed.
On PostCommit Transaction, I get a LazyInitializationException on the collection with the ContainedIn annotation.
I upload a test case to reproduce this, run the Boot class.
1/ Entity2 is not lacking @DocumentId, I read the doc again and again (my english is very poor, but ...) : "In fact since the 3.1.0 release of Hibernate Search @DocumentId is optional in the case where an @Id annotation exists."
2/ Entity2 is not lacking @IndexedEmbedded, see the "entity1" association.
3/ From Hibernate Entity Manager Doc : "In an EXTENDED persistence context, all read only operations of the entity manager can be executed outside a transaction (find(), getReference(), refresh(), and read queries). Some modifications operations can be executed outside a transaction, but they are queued until the persistence context join a transaction. This is the case of persist(), merge(), remove(). Some operations cannot be called outside a transaction: flush(), lock(), and update/delete queries.". This is the case of the attached test. I attach a second testcase with all the operation in a transaction, the result is the same.
4/ I check 3.1.1-GA, the problem occurs alway.
5/ All the operation are in a transaction.
Please read and run my testcase and if I missuse hibernate say me where.
I can't reopen the bug HSEARCH-342, I open a new bug because the resolution of the bug HSEARCH-178 don't resolve this problem.
Thank you.
--
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
15 years, 5 months
[Hibernate-JIRA] Created: (HHH-4912) testManyToManyWithFormula induces error with Ingres dialect
by Ray Fan (JIRA)
testManyToManyWithFormula induces error with Ingres dialect
-----------------------------------------------------------
Key: HHH-4912
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4912
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.5.0-Beta-4
Environment: Hibernate 3.5.0-Beta-4, Ingres 9.3.1
Reporter: Ray Fan
Attachments: manytomany-logs.zip
During test org.hibernate.test.manytomany.ManyToManyTest an error is encountered when using the Ingres dialect.
{noformat}
testcase time="0.806" classname="org.hibernate.test.manytomany.ManyToManyTest" name="testManyToManyWithFormula">
<error message="could not execute query" type="org.hibernate.exception.GenericJDBCException">org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:132)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:120)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2257)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:859)
at org.hibernate.test.manytomany.ManyToManyTest.testManyToManyWithFormula(ManyToManyTest.java:92)
Caused by: com.ingres.gcf.util.SqlEx: line 1, Column 'username' found in more than one FROM list table.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1597)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2254)
... 39 more
{noformat}
The generated SQL query from HQL: from org.hibernate.test.manytomany.User u join fetch u.groups g join fetch g.users
{noformat}
select
user0_.name as name3854_0_,
user0_.org as org3854_0_,
group2_.name as name3856_1_,
group2_.org as org3856_1_,
user4_.name as name3854_2_,
user4_.org as org3854_2_,
group2_.description as descript3_3856_1_,
groups1_.userName as userName0__,
groups1_.org as org0__,
groups1_.groupName as groupName0__,
groups1_.org as formula31_0__,
users3_.groupName as groupName1__,
users3_.org as org1__,
userName as userName1__,
users3_.org as formula32_1__
from
'User' user0_
inner join
UserGroup groups1_
on user0_.name=groups1_.userName
and user0_.org=groups1_.org
inner join
'Group' group2_
on groups1_.groupName=group2_.name
and groups1_.org=group2_.org
inner join
UserGroup users3_
on group2_.name=users3_.groupName
and group2_.org=users3_.org
inner join
'User' user4_
on users3_.userName=user4_.name
and users3_.org=user4_.org
{noformat}
seems to includes userName as userName1__ in the select list without table qualification. Ingres is unable to disambiguate the column from groups1_ or users3_ and raises the error.
Attaching test logs.
--
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
15 years, 5 months
[Hibernate-JIRA] Created: (HHH-5087) A @ManyToOne field on the same entity class is null when 2nd level cache is enabled
by Joseph Pachod (JIRA)
A @ManyToOne field on the same entity class is null when 2nd level cache is enabled
-----------------------------------------------------------------------------------
Key: HHH-5087
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5087
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.5.0-Final, 3.3.0.CR1
Reporter: Joseph Pachod
Attachments: demos.tar.gz
The issue is based on this discussion https://forum.hibernate.org/viewtopic.php?p=2350265 which shows how to have a List with the index managed by Hibernate.
The example given involves two distinct entities classes, for example ParentEntity.class et ChildEntity.class.
I tried to use it as well for a List containing the same entity, like that (see attachment for more details):
public class RecursiveListItem
{
(..)
public void setParent(final RecursiveListItem parent)
{
this.parent = parent;
}
public RecursiveListItem getParent()
{
return parent;
}
public static final String RECURSIVELISTITEM_ONETOMANY_INDEX_COLUMN_NAME = "recursivelistitem_position";
public static final String RECURSIVELISTITEM_ONETOMANY_JOIN_COLUMN_NAME = "recursivelistitem_id";
@ManyToOne
@JoinColumn(name = RECURSIVELISTITEM_ONETOMANY_JOIN_COLUMN_NAME, insertable = false, updatable = false)
private RecursiveListItem parent;
@SuppressWarnings("unused")
@Column(name = RECURSIVELISTITEM_ONETOMANY_INDEX_COLUMN_NAME, insertable = false, updatable = false)
private Integer position;
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = RecursiveListItem.RECURSIVELISTITEM_ONETOMANY_JOIN_COLUMN_NAME)
@org.hibernate.annotations.IndexColumn(name = RecursiveListItem.RECURSIVELISTITEM_ONETOMANY_INDEX_COLUMN_NAME)
private List<RecursiveListItem> children = new ArrayList<RecursiveListItem>();
(...)
}
In my test case, I do :
EntityManager entityManager = entityManagerFactory.createEntityManager();
RecursiveListItem parent = new RecursiveListItem();
RecursiveListItem child = new RecursiveListItem();
persist(entityManager, parent);
persist(entityManager, child);
parent.getChildren().add(child);
child.setParent(parent);
persist(entityManager, parent);
persist(entityManager, child);
entityManager.close();
entityManager = entityManagerFactory.createEntityManager();
RecursiveListItem childFound = entityManager.find(RecursiveListItem.class, child.getId());
assertNotNull(childFound);
assertNotNull(childFound.getParent());
The last line works when the 2nd level cache and fails otherwise.
The issue applies both for 3.5 and 3.3.0.CR1. In the attached file I put two maven enabled eclipse projects, on for 3.5 and one for 3.3.0.CR1.
Thanks in advance
best regards
joseph
ps : I'll be on vacation until next Monday (April 12)
--
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
15 years, 5 months
[Hibernate-JIRA] Created: (HHH-2295) entity-name attribute's syntax not clearly documented
by Jeremy Michael Crosbie (JIRA)
entity-name attribute's syntax not clearly documented
-----------------------------------------------------
Key: HHH-2295
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2295
Project: Hibernate3
Type: Bug
Components: documentation
Versions: 3.2.1
Environment: Windows XP/JDK 1.5/HypersonicSQL
Reporter: Jeremy Michael Crosbie
Priority: Minor
Attachments: Group.hbm.xml
Setting entity-name to a value containing a hyphen, in my case 'lender-group' causes odd behaviors seemingly only when calling get() or load(). Also in my case I am mapping a class to two different tables (attached). The first mapping has an entity name with a hyphen, the other does not. When I call load *after committing a transaction where a new entity is persisted* I get an exception (see below). The exception complains of a column called "LENDER" not existing. But once I change the entity-name to something like 'lendergroup' the problem goes away. Interestingly, the missing column complained about is the text before the hyphen, so if I name the entity 'lndr-group' it complains of a column name 'LNDR' not existing.
It almost appears if this format is assuming some sort of discriminator, but the online docs are terse when it comes to describing the entity-name field.
Exception:
org.hibernate.exception.SQLGrammarException: could not load an entity: [lender-group#G9]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1799)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:47)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:41)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:799)
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 org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy0.get(Unknown Source)
at com.fares.mtrac.group.GroupDaoImpl.findById(GroupDaoImpl.java:148)
at com.fares.mtrac.group.GroupDaoImplTest.testFindByIdStringCompanyType(GroupDaoImplTest.java:256)
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:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.sql.SQLException: Column not found: LENDER in statement [select lender-gro0_.group_cd as group1_48_0_, lender-gro0_.group_nm as group2_48_0_, lender-gro0_.user_nm as user3_48_0_ from lender_group_name lender-gro0_ where lender-gro0_.group_cd=?]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
... 36 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
15 years, 5 months