[Hibernate-JIRA] Created: (HHH-6704) Postgresql test failures
by Strong Liu (JIRA)
Postgresql test failures
------------------------
Key: HHH-6704
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6704
Project: Hibernate Core
Issue Type: Sub-task
Reporter: Strong Liu
org.hibernate.test.annotations.dataTypes.BasicOperationsTest.testCreateAndDelete
org.hibernate.test.annotations.query.QueryAndSQLTest.testNativeQueryWithFormulaAttribute
org.hibernate.test.cascade.circle.MultiPathCircleCascadeCheckNullibilityFalseTest.testMergeEntityWithNonNullableTransientEntity
org.hibernate.test.cascade.circle.MultiPathCircleCascadeTest.testMergeEntityWithNonNullableTransientEntity
org.hibernate.test.legacy.CustomSQLTest.testInsert
org.hibernate.test.tm.CMTTest.testConcurrentCachedDirtyQueries
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-6703) id element has 'column' attribute, then the pk column is nullable in ddl created by schema export
by Strong Liu (JIRA)
id element has 'column' attribute, then the pk column is nullable in ddl created by schema export
---------------------------------------------------------------------------------------------------
Key: HHH-6703
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6703
Project: Hibernate Core
Issue Type: Bug
Components: metamodel
Affects Versions: 4.0.0.CR4
Reporter: Strong Liu
this can be reproduced by org.hibernate.test.discriminator.SimpleInheritanceTest#testDiscriminatorSubclass
in SimpleInheritance.hbm.xml:
{code:xml}
<id name="id"
column="person_id"
unsaved-value="0">
<generator class="assigned"/>
</id>
{code}
and sql generated is
{quote}
create table "Person" (
"person_id" bigint,
"TYPE" char(255),
"name" varchar(255) not null,
"sex" char(255) not null,
"title" varchar(255),
"salary" decimal(19,2),
"comments" varchar(255),
primary key ("person_id")
)
{quote}
if we remove that _column="person_id"_, then it changes to
{quote}
create table "Person" (
"id" bigint not null,
"TYPE" char(255),
"name" varchar(255) not null,
"sex" char(255) not null,
"title" varchar(255),
"salary" decimal(19,2),
"comments" varchar(255),
primary key ("id")
)
{quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (JPA-23) Isolation concurrency between persistence context
by Cédric Chantepie (JIRA)
Isolation concurrency between persistence context
-------------------------------------------------
Key: JPA-23
URL: http://opensource.atlassian.com/projects/hibernate/browse/JPA-23
Project: Java Persistence API
Issue Type: Bug
Affects Versions: 1.0.0
Environment: JBoss 5.1.0.GA / sun jdk 1.6 / PostgreSQL 8.x / Hibernate EntityManager 3.4
Reporter: Cédric Chantepie
I have an EJB3 MDB deployed in JBoss (container transaction, transaction Required for onMessage), this MDB uses injected EntityManager (JTA one injected with @PersistenceContext type=Transaction in MDB) in order to update a same value as property for 2 differents entities (mapped on 2 differents tables in PostgreSQL database).
If I check by hand in database (with psql client), everything is coherent as the value is the same in the 2 involved tables.
I also trigger MDB from a standalone JUnit TestCase (runned by maven). In order to be aware in this test that MDB transaction is successfully commited, I register a Synchronisation instance in MDB, and in afterCompletion method I send back to the JMS confirmation message (as TestCase is also a MessageListener to be notified).
In this case, TestCase is properly notified that MDB work is completed, but when it try to check value using its own EntityManager (as TestCase is outside JBoss), sometimes (not always unluckily) this value is ok in one table/entity but not in the other.
I've tried various hibernate settings (isolation level, hibernate.transaction.factory_class, hibernate.transaction.manager_lookup_class), but trouble still occurs.
EntityManager used by TestCase is a RESOURCE_LOCAL one.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-6591) JPA QL's NEW MyClass(...) construct fails - number of constructor params used during validation
by Ondrej Zizka (JIRA)
JPA QL's NEW MyClass(...) construct fails - number of constructor params used during validation
-----------------------------------------------------------------------------------------------
Key: HHH-6591
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6591
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.6.6, 3.6.5, 3.6.4
Reporter: Ondrej Zizka
Priority: Critical
This
{code}
List<MyClass> list = em.createQuery("SELECT NEW org.test.MyClass( 'Foo', 123 ) FROM IrcEvent ev", MyClass.class).getResultList();
{code}
and this
{code}
List<Object[]> list = em.createQuery("SELECT 'Foo', 123 FROM IrcEvent ev", Object[].class).getResultList();
{code}
ends up with:
{quote}
java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return
{quote}
Both should work according to docs.
This has been reported and worked on as per HHH-5348, but the issue prevails.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1268) Unidirection OneToMany causes duplicate key entry violation when removing from list
by Stephan van Hugten (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1268?page=c... ]
Stephan van Hugten commented on HHH-1268:
-----------------------------------------
I ran into this some days ago I think. Ultimately, it was a mapping mistake on my account, but the error it caused was similar to this.
My mapping in FOO:
@OneToMany
@JoinTable(name = "SCHEMA_FOO2BAR",
joinColumns = { @JoinColumn(name = "FOO_PO_ID") },
inverseJoinColumns = { @JoinColumn(name = "BAR_PO_ID")})
private List<BAR> bars;
What I saw was that on update of this collection Hibernate first puts an EntityUpdateAction in the ActionQueue. This Entity already has the latest state of the Bag in it and will update the join table. After that it concludes that the collection is dirty and also puts one or more CollectionUpdateActions in the ActionQueue which will also update the join table ---> Exception. Seems a bit redundant. I saw this happening in the AbstractFlushingEventListener at line 282 (version 3.3.1).
> 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
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months