-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate Dropping and Create database tables
PostPosted: Thu May 11, 2017 10:34 pm 
Newbie

Joined: Thu May 11, 2017 10:08 pm
Posts: 5
Hi

We would like to request for everyone's help regarding our customized hibernate version 3.2.6. we are encountering create and drop behavior running on CentOS 6.9 (see the configuration made to each application hibernate files.

hibernate.properties

hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.query.substitutions=true 'Y', false 'N'
hibernate.cache.use_second_level_cache=true
hibernate.cache.provider_class=net.sf.ehcache.hibernate.SingletonEhCacheProvider
net.sf.ehcache.configurationResourceName=/ehcache.xml
hibernate.show_sql=true
hibernate.format_sql=true
hibernate.use_sql_comments=false
hibernate.jdbc.batch_size=50
#hibernate.jdbc.factory_class=net.bull.javamelody.HibernateBatcherFactory
hibernate.hbm2ddl.auto=none

jdbc-oracle.properties

jdbc.driverClassName=oracle.jdbc.OracleDriver
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
hibernate.hbm2ddl.auto=none

hibernate.cfg.xml

<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.137.106:1521:hcsgcdevdb</property>
<property name="hibernate.connection.username">hcstest</property>
<property name="hibernate.connection.password">hcstest</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.default_schema">hcstest</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">none</property>

server.log

12 May 2017 10:07:42,975 WARN [main] CustomEditorConfigurer.postProcessBeanFactory(187) | Passing PropertyEditor instances into CustomEditorConfigurer is deprecated: use PropertyEditorRegistrars or PropertyEditor class names instead. Offending key [java.util.Date; offending editor instance: org.springframework.beans.propertyeditors.CustomDateEditor@630f9225

12 May 2017 10:08:19,375 ERROR [main] SchemaExport.create(274) | Unsuccessful: create table hcstest.CTRL_APP (ID number(19,0) not null, APP_NAME varchar2(20 char) not null unique, primary key (ID), unique (APP_NAME))
12 May 2017 10:08:19,376 ERROR [main] SchemaExport.create(275) | ORA-02261: such unique or primary key already exists in the table

12 May 2017 10:08:19,390 ERROR [main] SchemaExport.create(274) | Unsuccessful: create table hcstest.CTRL_APP_USER (id number(19,0) not null, ACCOUNT_EXPIRED char(1 char), ACCOUNT_LOCKED char(1 char), CREATED_BY varchar2(50 char), CREATED_DATETIME timestamp, UPDATED_BY varchar2(50 char), UPDATED_DATETIME timestamp, CREDENTIALS_EXPIRED char(1 char), EMAIL varchar2(70 char), ACCOUNT_ENABLED char(1 char), PASSWORD varchar2(255 char), PASSWORD_EXPIRED char(1 char), PASSWORD_HINT varchar2(255 char), PERMISSIONS varchar2(60 char), USERNAME varchar2(50 char) not null unique, version number(10,0), ORGSTRUCTURE varchar2(5 char), EMPLOYEE varchar2(10 char), DOCTOR varchar2(10 char), SECTION varchar2(5 char), primary key (id), unique (USERNAME))

Everyone's help is very appreciated.

Thank you


Top
 Profile  
 
 Post subject: Re: Hibernate Dropping and Create database tables
PostPosted: Thu May 11, 2017 11:42 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Since hbm2ddl is set to none:

Code:
hibernate.hbm2ddl.auto=none


How do you get Hibernate to generate the DDL?

Code:
such unique or primary key already exists in the table


Anyway, you should be using Flyway instead of hbm2ddl which is only meant for Hibernate testing. Also, Hibernate version 3.2.6 is too old. Even if it's an issue, it won't be fixed. You have to migrate to the latest version if you want bugs to get fixed.


Top
 Profile  
 
 Post subject: Re: Hibernate Dropping and Create database tables
PostPosted: Mon May 15, 2017 9:29 pm 
Newbie

Joined: Thu May 11, 2017 10:08 pm
Posts: 5
Hi
The application behaves differently on other servers, i have tested it 3x. 1 server uses hibernate.properties instead of hibernate.cfg.xml (which is the correct one or working) and the other one is reading the hibernate.cfg.xml instead of hibernate.properties (which is wrong).

Is there a way the the operating system caused this behavior?

Your help will be much appreciated

Thank you.


Top
 Profile  
 
 Post subject: Re: Hibernate Dropping and Create database tables
PostPosted: Tue May 16, 2017 1:26 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Hibernate 3.2 is very old and no longer maintained. You can debug it to see why it's behaving like that. However, if there's a bug, it will not be fixed. If you can replicate the problem on 5.2, then we can further investigate it.


Top
 Profile  
 
 Post subject: Re: Hibernate Dropping and Create database tables
PostPosted: Thu Jun 01, 2017 10:50 pm 
Newbie

Joined: Thu May 11, 2017 10:08 pm
Posts: 5
Thanks Guys


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.