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

Hibernate Java Discussion :

hibernate pb avec création de session


Sujet :

Hibernate Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Février 2006
    Messages
    83
    Détails du profil
    Informations forums :
    Inscription : Février 2006
    Messages : 83
    Par défaut hibernate pb avec création de session
    Bonjour a tous, je suis débutant j'ai fais mon premier projet, ou j'essaye d'insérer une ligne dans une table et voila ce qui s'affiche sur la console, et bien sur rien dans ma table, ceci s'affiche juste après : Session session = HibernateUtil.currentSession();

    Maintenant je n'avance plus, je n'ai aucune idée pour évoluer, c'est pourquoi j'en appel à vos lumières !!


    16:44:25,566 INFO Environment:514 - Hibernate 3.2.6
    16:44:25,581 INFO Environment:547 - hibernate.properties not found
    16:44:25,581 INFO Environment:681 - Bytecode provider name : cglib
    16:44:25,581 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
    16:44:25,660 INFO Configuration:1432 - configuring from resource: /hibernate.cfg.xml
    16:44:25,660 INFO Configuration:1409 - Configuration resource: /hibernate.cfg.xml
    16:44:25,753 INFO Configuration:559 - Reading mappings from resource : test/Target.hbm.xml
    16:44:25,847 INFO HbmBinder:300 - Mapping class: test.Target -> target
    16:44:25,863 INFO Configuration:559 - Reading mappings from resource : test/Node.hbm.xml
    16:44:25,894 INFO HbmBinder:300 - Mapping class: test.Node -> node

    16:44:25,894 INFO Configuration:1547 - Configured SessionFactory: null

    16:44:25,956 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
    16:44:25,956 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
    16:44:25,956 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
    16:44:25,972 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql:///nod
    16:44:25,972 INFO DriverManagerConnectionProvider:86 - connection properties: {user=root}
    16:44:26,269 INFO SettingsFactory:89 - RDBMS: MySQL, version: 5.0.27-community-log
    16:44:26,269 INFO SettingsFactory:90 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
    16:44:26,300 INFO Dialect:152 - Using dialect: org.hibernate.dialect.MySQLDialect
    16:44:26,300 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
    16:44:26,300 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    16:44:26,300 INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled
    16:44:26,300 INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled
    16:44:26,300 INFO SettingsFactory:154 - JDBC batch size: 15
    16:44:26,300 INFO SettingsFactory:157 - JDBC batch updates for versioned data: disabled
    16:44:26,300 INFO SettingsFactory:162 - Scrollable result sets: enabled
    16:44:26,300 INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): enabled
    16:44:26,300 INFO SettingsFactory:178 - Connection release mode: auto
    16:44:26,300 INFO SettingsFactory:202 - Maximum outer join fetch depth: 2
    16:44:26,300 INFO SettingsFactory:205 - Default batch fetch size: 1
    16:44:26,316 INFO SettingsFactory:209 - Generate SQL with comments: disabled
    16:44:26,316 INFO SettingsFactory:213 - Order SQL updates by primary key: disabled
    16:44:26,316 INFO SettingsFactory:217 - Order SQL inserts for batching: disabled
    16:44:26,316 INFO SettingsFactory:386 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    16:44:26,316 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
    16:44:26,316 INFO SettingsFactory:225 - Query language substitutions: {}
    16:44:26,316 INFO SettingsFactory:230 - JPA-QL strict compliance: disabled
    16:44:26,316 INFO SettingsFactory:235 - Second-level cache: enabled
    16:44:26,316 INFO SettingsFactory:239 - Query cache: disabled
    16:44:26,316 INFO SettingsFactory:373 - Cache provider: org.hibernate.cache.NoCacheProvider
    16:44:26,316 INFO SettingsFactory:254 - Optimize cache for minimal puts: disabled
    16:44:26,347 INFO SettingsFactory:263 - Structured second-level cache entries: disabled
    16:44:26,347 INFO SettingsFactory:290 - Statistics: disabled
    16:44:26,347 INFO SettingsFactory:294 - Deleted entity synthetic identifier rollback: disabled
    16:44:26,347 INFO SettingsFactory:309 - Default entity-mode: pojo
    16:44:26,347 INFO SettingsFactory:313 - Named query checking : enabled
    16:44:26,378 INFO SessionFactoryImpl:161 - building session factory
    16:44:26,659 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured

  2. #2
    Membre chevronné
    Profil pro
    Développeur Java
    Inscrit en
    Novembre 2007
    Messages
    301
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur Java

    Informations forums :
    Inscription : Novembre 2007
    Messages : 301
    Par défaut
    Montre nous au moins le code de ton insertion pour voir ou se situe le problème.

    M'enfin, je parie sur le fait que tu n'as géré les transactions :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    Session sess = HibernateUtil.currentSession();
     Transaction tx;
     try {
         tx = sess.beginTransaction();
         // sess.save(myObject);
         tx.commit();
     }
     catch (Exception e) {
         if (tx!=null) tx.rollback();
         throw e;
     }
     finally {
         sess.close();
     }

Discussions similaires

  1. Problème de création de session avec JSF
    Par AllanRidley dans le forum JSF
    Réponses: 4
    Dernier message: 05/07/2011, 11h52
  2. création variable session avec JSF
    Par psycho_xn dans le forum JSF
    Réponses: 4
    Dernier message: 23/08/2008, 23h18
  3. Réponses: 2
    Dernier message: 29/11/2007, 15h25
  4. [Plugin][Hibernate]Eclipse avec hibernate(synchronizer)
    Par mg67 dans le forum Eclipse Java
    Réponses: 7
    Dernier message: 23/06/2005, 17h19
  5. [C#] Créations de sessions
    Par en_gel_ho dans le forum Windows Forms
    Réponses: 3
    Dernier message: 07/04/2005, 10h06

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