-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Oracle 11g R1 Schema Update not works
PostPosted: Thu May 10, 2012 3:36 am 
Beginner
Beginner

Joined: Sat Nov 19, 2005 11:54 am
Posts: 22
i`m using hibernate 3.6.0.final and oracle 11g R1
when set hbm2ddl.auto to create mode it works
but when set hbm2ddl.auto to update mode and drop a column or a table from that schema:

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2536)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at ir.saeed.db.SpringDBUtil.list(SpringDBUtil.java:97)
at ir.saeed.db.SpringDBUtil$$FastClassByCGLIB$$75c004c.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
at ir.saeed.db.SpringDBUtil$$EnhancerByCGLIB$$34c68088.list(<generated>)

at ir.saeed.db.TestClass.testRead(TestClass.java:33)
at ir.saeed.db.TestClass.main(TestClass.java:69)
... 5 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "THIS_3_"."ID": invalid identifier

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:863)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3620)


Top
 Profile  
 
 Post subject: Re: Oracle 11g R1 Schema Update not works
PostPosted: Fri May 11, 2012 2:22 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
An earlier version of the documentation said that hibernate.hbm2ddl.auto=update was experimental.
I believe it is still so.


Top
 Profile  
 
 Post subject: Re: Oracle 11g R1 Schema Update not works
PostPosted: Sat May 12, 2012 4:35 am 
Beginner
Beginner

Joined: Sat Nov 19, 2005 11:54 am
Posts: 22
when i use another database on another machine it works
and when i use this machine and hbm2ddl.auto=create it works
but just when i use this machine and hbm2ddl.auto=update or hbm2ddl.auto=validate it does not work
i don`t know what is the problem
anybody can help me?????


Top
 Profile  
 
 Post subject: Re: Oracle 11g R1 Schema Update not works
PostPosted: Sat May 12, 2012 9:34 am 
Beginner
Beginner

Joined: Sat Nov 19, 2005 11:54 am
Posts: 22
i`ve changed my hibernate version to 4.1.3.FINAL
but not works with update and just works with create


Top
 Profile  
 
 Post subject: Re: Oracle 11g R1 Schema Update not works
PostPosted: Sun May 13, 2012 1:57 am 
Beginner
Beginner

Joined: Sat Nov 19, 2005 11:54 am
Posts: 22
what is doing hbm2ddl.auto=update????
i mean i want java code of that and sql that send to database


Top
 Profile  
 
 Post subject: Re: Oracle 11g R1 Schema Update not works
PostPosted: Sun May 13, 2012 7:39 am 
Beginner
Beginner

Joined: Sat Nov 19, 2005 11:54 am
Posts: 22
i`ve downloaded hibernate source code and set a breakpoint to Confuguration Class
and saw when hibernate going to create sql it think table already exist!!!!!
i saw my schema and the table is not in my schema and it is in another schema
i`ve checked my synonyms but synonym not exists
i`ve changed my db user`s roles and removed mgmt_user and dba
and problem resolved!!!!!!!!!!!
is than hibernate bug??????


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.