Hallo! Vielleicht kann mir jemand helfen:
Wenn ich auf einer Oracle DB ein automatisches Schema Update machen möchte, versucht Hibernate jedes Mal die Sequences neu anzulegen obwohl sie bereits existieren und es fliegt eine SQLException (ORA-00955).
Hat jemand einen Vorschlag für mich?
Hibernate version:
3.0.5
Mapping documents:
<snip>
Code:
<class name="Event"
table="events" discriminator-value="E">
<id name="eventID" type="long">
<generator class="native">
<param name="sequence">seq_events</param>
</generator>
</id>
</snip>
<snip>
Code:
<property name="connection.url">jdbc:oracle:thin:@xxxxxx</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.username">xxxxx</property>
<property name="connection.password">xxxxx</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="default_schema">SITWARE</property>
<!-- schema export settings -->
<property name="hbm2ddl.auto">update</property>
</snip>
Full stack trace of any exception that occurs:Code:
12:49:55,157 DEBUG SqlUtils:83 - Attempted to convert SQLException to SQLExcepti
on. Leaving it alone. [SQLState: 42000; errorCode: 955]
java.sql.SQLException: ORA-00955: name is already used by an existing object
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
(Compiled Code))
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java(Compiled Cod
e))
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java(Inlined Comp
iled Code))
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java(Compiled Code))
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1168)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatem
ent.java:1614)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java
:1579)
at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStat
ement.java:64)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:143
)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
265)
a:1005)
at sapphir.sit.sitware.core.db.HibernateImplementation.initComponent(Unk
nown Source)
at sapphir.sit.sitware.core.BaseConfiguration.configureDatabaseAccess(Un
known Source)
at sapphir.sit.sitware.core.SITware.init(Unknown Source)
at sapphir.sit.sitware.core.SITware.<init>(Unknown Source)
at sapphir.sit.sitware.core.SITware.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java
:136)
at java.lang.Thread.run(Thread.java:568)
12:49:55,187 ERROR SchemaUpdate:148 - Unsuccessful: create sequence SITWARE.seq_
configurations
12:49:55,188 ERROR SchemaUpdate:149 - ORA-00955: name is already used by an exis
ting object
Name and version of the database you are using:
Oracle9i 9.2.0.7.0