IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JDBC Java Discussion :

Base fantôme avec HSQL/ Hibernate / JPA ?


Sujet :

JDBC Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau candidat au Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Avril 2012
    Messages : 2
    Par défaut Base fantôme avec HSQL/ Hibernate / JPA ?
    Bonjour, j'ai un problème concernant l'utilisation de la persistence via hibernate, JPA et hsql.

    J'ai utilisé le tutoriel des sites suivants :

    http://blog.m1key.me/2010/06/eclipse...qldb-part.html

    http://blog.m1key.me/2010/06/eclipse...b-part_23.html

    Je ne comprends pas. Je n'ai aucun message d'erreur et mon code s'execute correctement. Cependant, quand je regarde manuellement dans ma table à l'aide du hsqldb.jar, je n'ai rien dans ma base de données. Les URL de connexion sont correctes et toutes identiques et pointent vers la même base.

    Qu'est ce que ce code fait exactement ? Y-a-il création d'une base-fantôme créée et immédiatement détruite après l'execution d'une code ?

    Merci d'avance,

    Voici le message qui apparait dans la console :
    0 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.5.3-Final
    15 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.5.3-Final
    15 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
    15 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
    15 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
    109 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
    125 [main] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.5.3-Final
    438 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: me.m1key.dogs.dao.Dog
    469 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity me.m1key.dogs.dao.Dog on table Dog
    500 [main] INFO org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring
    516 [main] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
    563 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
    563 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
    563 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: true
    563 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:\workspace\Dogs\db\dogsdb
    563 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=sa, autocommit=true, release_mode=auto}
    1016 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: HSQL Database Engine, version: 1.8.0
    1016 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: HSQL Database Engine Driver, version: 1.8.0
    1032 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.HSQLDialect
    1032 [main] INFO org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
    1047 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
    1047 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    1047 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: enabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
    1047 [main] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
    1079 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
    1188 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
    1204 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - Running hbm2ddl schema export
    1204 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - exporting generated schema to database
    1204 [main] INFO org.hibernate.tool.hbm2ddl.SchemaExport - schema export complete
    Hibernate:
    insert
    into
    PUBLIC.Dog
    (id, name)
    values
    (null, ?)
    Hibernate:
    call identity()
    Hibernate:
    insert
    into
    PUBLIC.Dog
    (id, name)
    values
    (null, ?)
    Hibernate:
    call identity()
    Hibernate:
    select
    dog0_.id as id0_,
    dog0_.name as name0_
    from
    PUBLIC.Dog dog0_
    Sega 1
    Assan 2
    1501 [main] INFO org.hibernate.impl.SessionFactoryImpl - closing
    1501 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - cleaning up connection pool: jdbc:hsqldb:\workspace\Dogs\db\dogsdb

  2. #2
    Nouveau candidat au Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Avril 2012
    Messages : 2
    Par défaut
    J'ai trouvé la solution :

    J'ai rajouté la propriété ":file" au début de mon url de connexion comme cela : jdbc:hsqldb:file.....

    Et, dans mon fichier "persistence.xml", j'ai rajouté la propriété suivante :

    <property name="hibernate.connection.shutdown" value="true" />

  3. #3
    Membre Expert
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Juin 2007
    Messages
    2 938
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Juin 2007
    Messages : 2 938
    Par défaut
    Citation Envoyé par fffabien Voir le message
    J'ai trouvé la solution :

    J'ai rajouté la propriété ":file" au début de mon url de connexion comme cela : jdbc:hsqldb:file.....

    Et, dans mon fichier "persistence.xml", j'ai rajouté la propriété suivante :

    <property name="hibernate.connection.shutdown" value="true" />
    Tant mieux, passe donc le sujet à "résolu", ca facilite les recherches pour les autres.

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Novembre 2011
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2011
    Messages : 16
    Par défaut
    Bonjour,

    J'ai le même problème.
    Je créer une connexion entre mon application et hsql, cela fonctionne mais des que la connexion est fermer, les données sont perdus.

    J'ai donc essayer la solution cité juste au dessus mais je ne trouve pas les fichiers relatif à ma base. Et quand je pointe le répertoire où je pense est ma base, l’exécution se passe correctement, des fichier se crée et se supprime, mais toujours rien quand je vais voir ma base avec le client hsql.

    avez vous une idée?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 07/10/2014, 08h59
  2. Réponses: 19
    Dernier message: 03/07/2013, 10h26
  3. [Integration] Problème d'intégration d'un Applet JAVA tournant avec Spring / Hibernate / JPA
    Par anthony22360 dans le forum Spring
    Réponses: 1
    Dernier message: 02/07/2013, 17h41
  4. Réponses: 2
    Dernier message: 30/04/2013, 15h07
  5. Connexion à la base impossible avec hibernate
    Par jason69 dans le forum Hibernate
    Réponses: 3
    Dernier message: 29/06/2007, 15h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo