[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-954) Failing detection of Sequences?

Ana Ines (JIRA) noreply at atlassian.com
Thu Nov 15 06:58:30 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28838 ] 

Ana Ines commented on HBX-954:
------------------------------

I have the same problem, but using INFORMIX. 
There exist a solution, extending the InformixDialect :

package mypackage.persistence;

import org.hibernate.dialect.InformixDialect;

public class MyInformixDialect extends InformixDialect {
	
		
    public String getQuerySequencesString(){
        return "select tabname, tabtype, owner, tabid from informix.systables where tabtype in('Q') and tabname like '%' and owner like '%'";
    }
}

> Failing detection of Sequences?
> -------------------------------
>
>                 Key: HBX-954
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-954
>             Project: Hibernate Tools
>          Issue Type: Bug
>         Environment: Hibernate3 as provided by Seam 1.2.1GA (dunno which subversion)
> Oracle 10g
>            Reporter: Vincent Latombe
>
> Here is my problem : I used reverse engineering to get an entity from a table in a database.
> I got my entity then I wanted to add a generation for the Id. Fine, I add HIBERNATE_SEQUENCE which is needed then I add the annotation to my entity.
> I get this :
> 	@Id
> 	@Column(name = "ID", precision = 22, scale = 0)
> 	@GeneratedValue(strategy=GenerationType.SEQUENCE)
> 	@NotNull
> 	public long getId() {
> 		return this.id;
> 	}
> Nothing really difficult. Then I try to deploy my ejb using the validate strategy of hbm2ddl. And it fails because it can't find the sequence ([DatabaseMetadata] table not found: TESTSEAM.hibernate_sequence)... Ok strange. Then I switch to the update strategy... Now I get something interesting.
> 14:40:12,843 INFO  [DatabaseMetadata] table not found: TESTSEAM.hibernate_sequence
> 14:40:12,843 INFO  [DatabaseMetadata] table not found: hibernate_sequence
> 14:40:12,875 ERROR [SchemaUpdate] Unsuccessful: create sequence TESTSEAM.hibernate_sequence
> 14:40:12,875 ERROR [SchemaUpdate] ORA-00955: ce nom d'objet existe dÚjÓ
> 14:40:12,875 INFO  [SchemaUpdate] schema update complete
> It seems that DatabaseMetadata try to lookup a table instead of a sequence, so it can't detect the already existing sequence. So then it tries to create the sequence but it already exists. Any clue?

-- 
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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the hibernate-issues mailing list