[Hibernate-JIRA] Created: (HCANN-34) @Index Columns in @MappedSuperClasses don't work
by Mathias Reem (JIRA)
@Index Columns in @MappedSuperClasses don't work
------------------------------------------------
Key: HCANN-34
URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-34
Project: Hibernate Commons Annotations
Issue Type: Bug
Affects Versions: 3.2.0
Environment: hibernate-commons-annotations-3.2.0.jar
hibernate-core-3.6.0.jar
postgres
java 1.6
Reporter: Mathias Reem
Indices in MappedSuperclass are not created in each child Entity, but only in one of them, as index names are global (at least in postgres), for the other Entites I get errors:
10:00:17 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate]: Unsuccessful: create index hash on B (hash)
10:00:17 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate]: ERROR: relation "hash" already exists
{code:title=Root.java|borderStyle=solid}
@MappedSuperclass
abstract class Root {
@Column(nullable = false, unique = true)
@Index(name = "hash")
private String hash;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
// Getter, Setter, ...
}
{code}
{code:title=A.java|borderStyle=solid}
@Entity
public class A extends Root {
// Getter, Setter, ...
}
{code}
{code:title=B.java|borderStyle=solid}
@Entity
public class B extends Root {
// Getter, Setter, ...
}
{code}
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-5918) generate schema update script does not respect default schema and default catalog when querying foreign key contraints
by Christoph Weißenborn (JIRA)
generate schema update script does not respect default schema and default catalog when querying foreign key contraints
----------------------------------------------------------------------------------------------------------------------
Key: HHH-5918
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5918
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.1, 3.6.0, 3.5.6, 3.5.5, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0-Final, 3.3.2, 3.3.1, 3.3.0.SP1, 3.2.7, 3.2.6, 3.2.5, 3.2.4.sp1, 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.1.3, 3.1.2, 3.1.1, 3.1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0 final
Reporter: Christoph Weißenborn
Priority: Critical
When starting session factoring with mode "allow schema update" the database is inspected.
Table structures are queried within correct schema and catalog. But foreign key constraints and indexes were not. If a index/foreign key is defined in another schema at the same sql server, the index/foreign key is not created in the current schema.
The fix is very easy.
org.hibernate.cfg.Configuration (revision 20769), method generateSchemaUpdateScript(Dialect, DatabaseMetadata):
In line 1174 und 1175 use default schema und catalog if not specified for the table. This metadata is used for table structures.
Copy these 2 lines to 1217 und 1218 where the default schema and catalog is _not_ used when not specified for the table. This metadata is used for foreign key and indexes.
--
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, 2 months
[Hibernate-JIRA] Created: (HHH-5019) @TableGenerator throws Unsupported exception - error performing isolated work
by Rohini (JIRA)
@TableGenerator throws Unsupported exception - error performing isolated work
-----------------------------------------------------------------------------
Key: HHH-5019
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5019
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.1, 3.3.0.SP1, 3.3.0.GA, 3.3.0.CR2, 3.3.0.CR1, 3.2.7, 3.2.6, 3.2.5, 3.2.4.sp1, 3.2.4, 3.2.3, 3.2.2, 3.2.1
Environment: Hibernate Core 3.3.1, MySQL, Websphere 6.1 with EJB3.0 Feature pack
Reporter: Rohini
While implementing GenerationType.TABLE strategy with Hibernate as the persistence provider, id generation throws
javax.persistence.PersistenceException: org.hibernate.HibernateException: error performing isolated work
[3/18/10 14:40:41:533 IST] 0000002d SystemErr R at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
--------------------------------------------------------------
3/18/10 14:40:41:533 IST] 0000002d SystemErr R Caused by: org.hibernate.HibernateException: error performing isolated work
at org.hibernate.engine.transaction.Isolater$JtaDelegate.delegateWork(Isolater.java:166)
at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:64)
at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:74)
at org.hibernate.id.MultipleHiLoPerTableGenerator.generate(MultipleHiLoPerTableGenerator.java:210)
Looking at the
Isolater.doIsolatedWork( work, session );, implementation
try {
// First we need to suspend any current JTA transaction and obtain
// a JDBC connection
surroundingTransaction = transactionManager.suspend();
if ( log.isDebugEnabled() ) {
log.debug( "surrounding JTA transaction suspended [" + surroundingTransaction + "]" );
}
This happnes only with WebsphereExtendedTransactionManagerLookup as the hibernate.transaction.manager_lookup_class.
--
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, 2 months