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 :

Affichage d'un PDF ( blob ) depuis oracle -> Pourquoi UPDATE ?


Sujet :

Hibernate Java

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Août 2007
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2007
    Messages : 2
    Points : 2
    Points
    2
    Par défaut Affichage d'un PDF ( blob ) depuis oracle -> Pourquoi UPDATE ?
    Petit soucis avec hibernate !
    J'affiche un Document ( blob oracle ) au format pdf dans IE, le tout via une action struts qui retourne un byteArray.

    Tout se passe bien, le pdf s'affiche, malheureusement j'ai des soucis de perf et de lock et je m'apercois lorsque je debug hibernate qu'il y'a un update fait à chaque affichage du document. Hibernate detecte que le blob est "dirty" est donc a été modifié !!!

    Quelqu'un a-t-il déjà rencontré ce problème ?? Cela peut il venir de ma conf hibernate pour le document ?? Si oui, je peux mettre la conf ici si besoin ...

    Voici les logs bizarre que j'obtient :

    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.loader.Loader;result row: EntityKey[com.darty.redbox.core.modele.configuration.Document#103]
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.loader.Loader;Initializing object from ResultSet: [com.darty.redbox.core.modele.configuration.Document#103]
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.persister.entity.AbstractEntityPersister;Hydrating entity: [com.darty.redbox.core.modele.configuration.Document#103]
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.engine.TwoPhaseLoad;Version: 51
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.loader.Loader;done processing result set (1 rows)
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.jdbc.AbstractBatcher;about to close ResultSet (open ResultSets: 1, globally: 1)
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.jdbc.AbstractBatcher;about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.jdbc.AbstractBatcher;closing statement
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.loader.Loader;total objects hydrated: 1
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.engine.TwoPhaseLoad;resolving associations for [com.darty.redbox.core.modele.configuration.Document#103]
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.DefaultLoadEventListener;loading entity: [com.darty.redbox.core.modele.catalogue.TypeDocument#5]
    2007-10-02 17:49:49,069;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.DefaultLoadEventListener;creating new proxy for entity
    2007-10-02 17:49:49,303;http-0.0.0.0-8080-1;DEBUG;org.hibernate.engine.TwoPhaseLoad;done materializing entity [com.darty.redbox.core.modele.configuration.Document#103]
    2007-10-02 17:49:49,303;http-0.0.0.0-8080-1;DEBUG;org.hibernate.engine.StatefulPersistenceContext;initializing non-lazy collections
    2007-10-02 17:49:49,303;http-0.0.0.0-8080-1;DEBUG;org.hibernate.loader.Loader;done entity load
    2007-10-02 17:49:49,303;http-0.0.0.0-8080-1;DEBUG;org.hibernate.impl.SessionImpl;setting flush mode to: AUTO
    2007-10-02 17:49:49,303;http-0.0.0.0-8080-1;DEBUG;com.darty.redbox.core.web.action.RedBoxDownloadAction;postHandle methode
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.springframework.transaction.interceptor.TransactionInterceptor;Invoking commit for transaction on javax.servlet.Filter.doFilter
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.springframework.transaction.jta.JtaTransactionManager;Triggering beforeCommit synchronization
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;flushing session
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;processing flush-time cascades
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;dirty checking collections
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;Flushing entities and processing referenced collections
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.persister.entity.AbstractEntityPersister;com.darty.redbox.core.modele.configuration.Document.blobFile is dirty
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.DefaultFlushEntityEventListener;Updating entity: [com.darty.redbox.core.modele.configuration.Document#103]
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.engine.Versioning;Incrementing: 51 to 52
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;Processing unreferenced collections
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;Scheduling collection removes/(re)creates/updates
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.pretty.Printer;listing entities:
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.pretty.Printer;com.darty.redbox.core.modele.configuration.Document{modificationDate=2007-04-10 17:08:30, typeDocument=com.darty.redbox.core.modele.catalogue.TypeDocument#5, blobFile=org.hibernate.lob.SerializableBlob@1686ad9, creationDate=2007-04-10 17:08:30, id=103, version=51}
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.event.def.AbstractFlushingEventListener;executing flush
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.jdbc.ConnectionManager;registering flush begin
    2007-10-02 17:49:49,444;http-0.0.0.0-8080-1;DEBUG;org.hibernate.cache.UpdateTimestampsCache;Pre-invalidating space [T_DOCUMENT]

  2. #2
    Candidat au Club
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 2
    Points : 2
    Points
    2
    Par défaut
    j'ai le même problème ,interessé par un avis d'expert là dessus !

  3. #3
    Membre éclairé
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    614
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2006
    Messages : 614
    Points : 713
    Points
    713
    Par défaut
    Bonjour,

    On m'a toujours dit de me méfier du couple Oracle/Blob/hibernate (oui c'est un ménage à 3... )

    En gros on m'a expliqué que les Blobs étaient gérés de manière bizarre dans Hibernate et surtout que leur intégrité était difficilement garantie. Je parle là des objets de type Blob.

    Aussi, en ce qui me concerne, on m'avait conseillé lorsqu'il y a un Blob dans une table, d'utiliser dans le pojo un byte[] et d'implanter un usertype comme décrit ici : http://www.hibernate.org/73.html . Dans mon cas, les problèmes (qui n'étaient pas de ce type là) se sont résolus. Peut être est-ce une piste à explorer.

Discussions similaires

  1. Affichage d'un PDF depuis un TMemoryStream
    Par Jean-Jacques Engels dans le forum Composants VCL
    Réponses: 3
    Dernier message: 05/11/2011, 15h18
  2. Type BLOB depuis une base de données Oracle
    Par tunis71187 dans le forum Designer
    Réponses: 0
    Dernier message: 13/06/2011, 12h25
  3. Oracle insérer un BLOB depuis Matlab
    Par Mathusalem dans le forum MATLAB
    Réponses: 4
    Dernier message: 10/07/2006, 17h05
  4. Réponses: 17
    Dernier message: 15/05/2006, 12h28
  5. Affichage de documents PDF
    Par Dajon dans le forum C++Builder
    Réponses: 5
    Dernier message: 10/10/2002, 11h36

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