Hibernate nÃo grava - veja log

TO USANDO ODBC+ACCESS, ELE COMPLETA TODO PERCURSO MAS NAO
GRAVA NA BASE DE DADOS, TALVES PELO LOG CONSIGAM VER ALGUM ERRO, POIS EU NÃO VI.
ABRAÇOS A TODOS

[code]0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.2 cr3
31 [main] INFO org.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.connection.url=jdbc:ODBC:hibernate, hibernate.bytecode.use_reflection_optimizer=false, hibernate.connection.driver_class=sun.jdbc.odbc.JdbcOdbcDriver}
31 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : cglib
78 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
1562 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource: classes/Pessoa.hbm.xml
3234 [main] DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
3234 [main] DEBUG org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
3234 [main] DEBUG org.hibernate.util.DTDEntityResolver - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
4391 [main] INFO org.hibernate.cfg.HbmBinder - Mapping class: classes.Pessoa -> Pessoa
4438 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: nome -> nome
4563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: telefone -> telefone
4563 [main] DEBUG org.hibernate.cfg.HbmBinder - Mapped property: email -> email
4563 [main] DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
4563 [main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
4578 [main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
4578 [main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
4578 [main] DEBUG org.hibernate.cfg.Configuration - processing association property references
4578 [main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints
4969 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
4969 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
4969 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
4984 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: sun.jdbc.odbc.JdbcOdbcDriver at URL: jdbc:ODBC:hibernate
4984 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {}
4984 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
4984 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection
5797 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:ODBC:hibernate, Isolation Level: 2
5797 [main] DEBUG org.hibernate.cfg.SettingsFactory - could not get database version from JDBC metadata
5797 [main] INFO org.hibernate.cfg.SettingsFactory - RDBMS: ACCESS, version: 04.00.0000
5797 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC driver: JDBC-ODBC Bridge (odbcjt32.dll), version: 2.0001 (04.00.6200)
5813 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
5938 [main] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
5969 [main] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
5969 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
5984 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
5984 [main] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
5984 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
5984 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
5984 [main] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
5984 [main] DEBUG org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
5984 [main] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled
5984 [main] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
6000 [main] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
6000 [main] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
6000 [main] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
6000 [main] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
6000 [main] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
6016 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
6016 [main] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
6031 [main] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
6031 [main] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
6031 [main] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
6031 [main] INFO org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
6031 [main] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
6031 [main] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
6031 [main] DEBUG org.hibernate.exception.SQLExceptionConverterFactory - Using dialect defined converter
6156 [main] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
6156 [main] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
6156 [main] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
6672 [main] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
6672 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {}
8297 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: classes.Pessoa
8297 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select nome from Pessoa where nome =?
8297 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select pessoa_.nome, pessoa_.telefone as telefone0_, pessoa_.email as email0_ from Pessoa pessoa_ where pessoa_.nome=?
8297 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into Pessoa (telefone, email, nome) values (?, ?, ?)
8297 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update Pessoa set telefone=?, email=? where nome=?
8297 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from Pessoa where nome=?
8422 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity classes.Pessoa: select pessoa0_.nome as nome0_0_, pessoa0_.telefone as telefone0_0_, pessoa0_.email as email0_0_ from Pessoa pessoa0_ where pessoa0_.nome=?
8438 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity classes.Pessoa: select pessoa0_.nome as nome0_0_, pessoa0_.telefone as telefone0_0_, pessoa0_.email as email0_0_ from Pessoa pessoa0_ where pessoa0_.nome=?
8438 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity classes.Pessoa: select pessoa0_.nome as nome0_0_, pessoa0_.telefone as telefone0_0_, pessoa0_.email as email0_0_ from Pessoa pessoa0_ where pessoa0_.nome=? for update
8438 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity classes.Pessoa: select pessoa0_.nome as nome0_0_, pessoa0_.telefone as telefone0_0_, pessoa0_.email as email0_0_ from Pessoa pessoa0_ where pessoa0_.nome=? for update
8500 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity classes.Pessoa: select pessoa0_.nome as nome0_0_, pessoa0_.telefone as telefone0_0_, pessoa0_.email as email0_0_ from Pessoa pessoa0_ where pessoa0_.nome=?
8500 [main] DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity classes.Pessoa: select pessoa0_.nome as nome0_0_, pessoa0_.telefone as telefone0_0_, pessoa0_.email as email0_0_ from Pessoa pessoa0_ where pessoa0_.nome=?
8516 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
8516 [main] DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 8a9a85420cb6212c010cb621344a0000 (unnamed)
8531 [main] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
8531 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory
8531 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named HQL queries
8531 [main] DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named SQL queries
8750 [main] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 11541068647
8766 [main] DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener - saving transient instance
8766 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: adalberto, using strategy: org.hibernate.id.Assigned
8813 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - saving [classes.Pessoa#adalberto]
9031 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
9031 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
9031 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
9031 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
9047 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
9047 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
9063 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
9063 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
9063 [main] DEBUG org.hibernate.pretty.Printer - listing entities:
9063 [main] DEBUG org.hibernate.pretty.Printer - classes.Pessoa{nome=adalberto, email=adal@adal.com, telefone=8888-9999}
9063 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - executing flush
9063 [main] DEBUG org.hibernate.jdbc.ConnectionManager - registering flush begin
9063 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Inserting entity: [classes.Pessoa#adalberto]
9078 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
9078 [main] DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
9078 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
9078 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
9078 [main] DEBUG org.hibernate.SQL - insert into Pessoa (telefone, email, nome) values (?, ?, ?)
9078 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
9110 [main] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Dehydrating entity: [classes.Pessoa#adalberto]
9110 [main] DEBUG org.hibernate.type.StringType - binding ‘8888-9999’ to parameter: 1
9125 [main] DEBUG org.hibernate.type.StringType - binding ‘adal@adal.com’ to parameter: 2
9125 [main] DEBUG org.hibernate.type.StringType - binding ‘adalberto’ to parameter: 3
9125 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
9453 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
9453 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
9453 [main] DEBUG org.hibernate.jdbc.ConnectionManager - registering flush end

[/code]

Olá,

Você está dando commit na transação???

Abraços

To meio que pegando na unha, to seguindo uns tutoriais e uma apostila
se puder especificar melhor sobre esse Commit eu agradeço.

abraços

Olá,

Então, no seu código você deve fazer algo assim:

Session session = ...;
// Inicia a transação
Transaction transacao = session.beginTransaction();

try {
     session.saveOrUpdate(seuObjeto);

     // Você não deve estar fazendo essa linha
     // Efetiva a transação
     transacao.commit();
} catch (HibernateException e) {
     // Desfaz a transação
     transacao.rollback();
     throw e;
}

Abraços…

public void insert(Pessoa pessoa) throws Exception{ Session session = factory.openSession(); session.save(pessoa); session.flush(); session.close(); }
EU TAVA USANDO ESSE CODIGO…
MAS JA RESOLVI O MEU PROBLEMA AGRADEÇO A SUA AJUDA
TAVA MESMO FALTANDO…

ABRAÇOS E ATE MAIS