Hi guys, I'm simply persisting an entity in my database (I'm using Derby but I dont think it matters).
When I save it using Hibernate functions Save(entity), I got a message from the logger that I'm missing some stuff and there is error.
But, when I verify if the entity was added to the db, it works! The entity is now persisted in the DB.
So I would like to know what thoses messages mean, and by the way why it takes so long to save an entity like 10 seconds. (Maybe the delay is a consequence of the logger message)...
Thanks
Messages :
11:33:47,750 INFO SchemaExport:154 - Running hbm2ddl schema export
11:33:47,750 DEBUG SchemaExport:170 - import file not found: /import.sql
11:33:47,750 INFO SchemaExport:179 - exporting generated schema to database
11:33:47,750 DEBUG SchemaExport:303 - drop table ETUDIANTS if exists
11:33:47,812 DEBUG SchemaExport:288 - Unsuccessful: drop table ETUDIANTS if exists
11:33:47,812 DEBUG SchemaExport:289 - Syntax error: Encountered "if" at line 1, column 22.
11:33:47,812 DEBUG SchemaExport:303 - create table ETUDIANTS (ETUDIANT_ID bigint not null, ETUDIANT_PRENOM varchar(255), ETUDIANT_NOM varchar(255), ETUDIANT_CODE_PERMANENT varchar(255) not null, ETUDIANT_COURRIEL varchar(255), ETUDIANT_APPELLATION varchar(255), ETUDIANT_TELEPHONE varchar(255), ETUDIANT_PROGRAMME varchar(255), ETUDIANT_STATUS_LOG790 varchar(255), ETUDIANT_STATUS_PCL310 varchar(255), ETUDIANT_COTE_LOG790 varchar(255), primary key (ETUDIANT_ID), unique (ETUDIANT_CODE_PERMANENT))
11:33:47,968 ERROR SchemaExport:274 - Unsuccessful: create table ETUDIANTS (ETUDIANT_ID bigint not null, ETUDIANT_PRENOM varchar(255), ETUDIANT_NOM varchar(255), ETUDIANT_CODE_PERMANENT varchar(255) not null, ETUDIANT_COURRIEL varchar(255), ETUDIANT_APPELLATION varchar(255), ETUDIANT_TELEPHONE varchar(255), ETUDIANT_PROGRAMME varchar(255), ETUDIANT_STATUS_LOG790 varchar(255), ETUDIANT_STATUS_PCL310 varchar(255), ETUDIANT_COTE_LOG790 varchar(255), primary key (ETUDIANT_ID), unique (ETUDIANT_CODE_PERMANENT))
11:33:47,968 ERROR SchemaExport:275 - Table/View 'ETUDIANTS' already exists in Schema 'ME'.
11:33:47,968 INFO SchemaExport:196 - schema export complete
/****************************/
Hibernate.cfg.xml
/********************************/
<?xml version="1.0"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<!-- Dans IJ.bat - Pour creer la bd: connect 'jdbc:derby://localhost:1527/c:/DOGFDB;create=true;user=me;password=mine'; -->
<!-- Avec Ant dans dos : ant run -Daction=store -->
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
<property name="connection.url">jdbc:derby://localhost:1527/c:/DOGFDB</property>
<property name="connection.username">me</property>
<property name="connection.password">mine</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">10</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create-drop</property>
<!-- Echo all executed SQL to stdout -->
<!-- <property name="show_sql">true</property> -->
<mapping resource="domain/Etudiant.hbm.xml"/>
</session-factory>
</hibernate-configuration>
|