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 :

Bloque au flush() !


Sujet :

Hibernate Java

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2006
    Messages : 33
    Par défaut Bloque au flush() !
    Bonjour !

    Ce code marchait très bien jusqu'à aujourd'hui !

    session.update(booking);
    System.err.println("Update booking");
    session.flush();
    System.err.println("Update booking 2");

    Après le flush(), l'application est bloqué !

    Voici ce que ca m'affiche à l'écran :

    [09/07/07 15:20:29:461 CEST] 3cd79d51 SystemErr R Update booking

    [09/07/07 15:20:29:461 CEST] 3cd79d51 SystemOut O Hibernate: update TB_ATB_BOOKING set BOOKINGDATE=?, STATUS=?, SHUTTLE=?, REASONNOSHUTTLE=?, HASBEENBOOKEDBY=?, DESTINATIONID=?, SHUTTLE2=?, REASON2=? where TRIPID=? and USERID=?


    Je n'ai rien changé au ficheirs de configurations !


    Voici quelques informations en DEBUG :

    [09/07/07 16:16:17:988 CEST] 3f0ce4d3 SystemErr R Update booking
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - flushing session
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - Flushing entities and processing referenced collections
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - Updating entity: [com.fortis.atb.bl.dto.Booking#com.fortis.atb.bl.dto.Booking@72fee4c6[reason2=,shuttle2=1,destId=0,ownerId=1047,reason=,shuttle=3,status=Active,bookDate=Mon Jul 09 16:16:17 CEST 2007,userId=1047,tripId=213,securityPolicy=com.fortis.rsa.dto.security.DefaultSecurityPolicy@6185a4c1]]
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - Processing unreferenced collections
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - Scheduling collection removes/(re)creates/updates
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.Printer - listing entities:
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.Printer - com.fortis.atb.bl.dto.Booking{reason=, shuttle2=1, ownerId=1047, reason2=, destId=0, status=Active, bookDate=09 juillet 2007 16:16:17, shuttle=3}
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.SessionImpl - executing flush
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.persister.EntityPersister - Updating entity: [com.fortis.atb.bl.dto.Booking#com.fortis.atb.bl.dto.Booking@72fee4c6[reason2=,shuttle2=1,destId=0,ownerId=1047,reason=,shuttle=3,status=Active,bookDate=Mon Jul 09 16:16:17 CEST 2007,userId=1047,tripId=213,securityPolicy=com.fortis.rsa.dto.security.DefaultSecurityPolicy@6185a4c1]]
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.BatcherImpl - about to open: 0 open PreparedStatements, 0 open ResultSets
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.SQL - update TB_ATB_BOOKING set BOOKINGDATE=?, STATUS=?, SHUTTLE=?, REASONNOSHUTTLE=?, HASBEENBOOKEDBY=?, DESTINATIONID=?, SHUTTLE2=?, REASON2=? where TRIPID=? and USERID=?
    Hibernate: update TB_ATB_BOOKING set BOOKINGDATE=?, STATUS=?, SHUTTLE=?, REASONNOSHUTTLE=?, HASBEENBOOKEDBY=?, DESTINATIONID=?, SHUTTLE2=?, REASON2=? where TRIPID=? and USERID=?
    [09/07/07 16:16:17:988 CEST] 3f0ce4d3 SystemOut O 09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.BatcherImpl - preparing statement
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.persister.EntityPersister - Dehydrating entity: [com.fortis.atb.bl.dto.Booking#com.fortis.atb.bl.dto.Booking@72fee4c6[reason2=,shuttle2=1,destId=0,ownerId=1047,reason=,shuttle=3,status=Active,bookDate=Mon Jul 09 16:16:17 CEST 2007,userId=1047,tripId=213,securityPolicy=com.fortis.rsa.dto.security.DefaultSecurityPolicy@6185a4c1]]
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.TimestampType - binding '09 juillet 2007 16:16:17' to parameter: 1
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.StringType - binding 'Active' to parameter: 2
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.IntegerType - binding '3' to parameter: 3
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.StringType - binding '' to parameter: 4
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.IntegerType - binding '1047' to parameter: 5
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.IntegerType - binding '0' to parameter: 6
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.IntegerType - binding '1' to parameter: 7
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.StringType - binding '' to parameter: 8
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.IntegerType - binding '213' to parameter: 9
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.type.IntegerType - binding '1047' to parameter: 10
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.BatcherImpl - Adding to batch
    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.BatcherImpl - Executing batch size: 1




    Merci pour toute aide !!

  2. #2
    Membre Expert
    Homme Profil pro
    Directeur technique
    Inscrit en
    Janvier 2007
    Messages
    1 348
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Directeur technique

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 348
    Par défaut
    Si tu mets un try/catch autour du flush pour voir s'il y a une exception, ca donne quoi ?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2006
    Messages : 33
    Par défaut
    En fait y a deja un try/catch,
    voici mon code :

    try {
    System.err.println("setBooking : is Existing : "+isExisting);
    if (isExisting)
    {
    //save or update that booking in the database
    session.update(booking);
    System.err.println("Update booking");
    session.flush();
    System.err.println("Update booking 2"); } else {
    session.save(booking);
    System.err.println("save booking");
    session.flush(); }
    } catch (Exception e) {
    System.err.println("Ca marche pas pour le save booking");
    e.printStackTrace();
    }
    finally {
    try {
    HibernateUtil.closeSession();
    } catch (HibernateException e) {
    System.err.println("Exception : " +e.getMessage());
    }
    }

    Je n'ai pas d'exceptions il me semble, je n'ai rien à l'écran,
    la dernière ligne que je reçois c'est :

    09/07/2007 16:16:17,988 DEBUG 127.0.0.1 2epBYbDAeun3cvnJ9GDki_9 Facade-ATBBLFacade-setBooking [Servlet.Engine.Transports : 4] net.sf.hibernate.impl.BatcherImpl - Executing batch size: 1

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juin 2006
    Messages : 33
    Par défaut
    J'ai trouvé la cause du problème !!

    C'etait un deadlock sur la database avec une autre application !

    Merci.

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

Discussions similaires

  1. Requête SQL qui me bloque
    Par David Guillouet dans le forum Langage SQL
    Réponses: 5
    Dernier message: 27/04/2004, 14h52
  2. Bloque la date et l'heure sous Win XP ??
    Par Djedjeridoo dans le forum Windows
    Réponses: 2
    Dernier message: 05/04/2004, 12h11
  3. Réponses: 2
    Dernier message: 23/03/2004, 12h23
  4. Réponses: 1
    Dernier message: 23/02/2004, 12h58
  5. bloqué en mode Release
    Par matsch77 dans le forum MFC
    Réponses: 3
    Dernier message: 07/01/2004, 17h17

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