-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Hibernate not inserting data
PostPosted: Mon Aug 10, 2009 2:17 am 
Newbie

Joined: Sun Aug 09, 2009 10:45 pm
Posts: 1
elloo,

My hibernate does not insert data into the database table. The classes do not throw any error message however I have an hibernate sql statement which I'm not sure if it is going to be of any help.

anyhoo, here is the out put of hibernate class:-

Code:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Documents%20and%20Settings/Mizanur%20Rahman/Desktop/lib/slf4j-jdk14-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Documents%20and%20Settings/Mizanur%20Rahman/Desktop/lib/slf4j-nop-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Aug 10, 2009 3:51:47 AM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.3.2.GA
Aug 10, 2009 3:51:47 AM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Aug 10, 2009 3:51:47 AM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
Aug 10, 2009 3:51:47 AM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Aug 10, 2009 3:51:47 AM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /com/gospoken/hibernate.cfg.xml
Aug 10, 2009 3:51:47 AM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /com/gospoken/hibernate.cfg.xml
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : com/gospoken/entity/DigitalBible.hbm.xml
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: com.gospoken.entity.DigitalBible -> DigitalBible
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
Aug 10, 2009 3:51:48 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Aug 10, 2009 3:51:48 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
Aug 10, 2009 3:51:48 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
Aug 10, 2009 3:51:48 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/gospoken
Aug 10, 2009 3:51:48 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=root, password=****}
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: MySQL, version: 5.0.45-community-nt
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.8 ( Revision: ${svn.Revision} )
Aug 10, 2009 3:51:48 AM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.MySQLDialect
Aug 10, 2009 3:51:48 AM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
Aug 10, 2009 3:51:48 AM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): enabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Maximum outer join fetch depth: 2
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL inserts for batching: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
Aug 10, 2009 3:51:48 AM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory createRegionFactory
INFO: Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Aug 10, 2009 3:51:48 AM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
Aug 10, 2009 3:51:48 AM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Aug 10, 2009 3:51:48 AM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Hibernate: insert into DigitalBible (title, author, omaisbn, windowsmisbn, audibleisbn, correctdlpexvat, correctdlpinvat, CDISBN, CDexVAT, CDinVAT) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
BUILD SUCCESSFUL (total time: 1 second)


many thanks in advance.


Top
 Profile  
 
 Post subject: Re: Hibernate not inserting data
PostPosted: Mon Aug 10, 2009 7:27 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Quote:
I have an hibernate sql statement


My guess is that it won't have any effect.

Are you committing your transactions?
Code:
     session.beginTransaction();
    System.out.println("creating user");
   
    User u = new User();
    u.setPassword("abc123");
    session.saveOrUpdate(u);
    System.out.println("user saved");
    session.getTransaction().commit();


You might find this tutorial helpful:

http://jpa.ezhibernate.com/Javacode/lea ... hhibernate

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Hibernate not inserting data
PostPosted: Sat Jun 30, 2012 2:57 pm 
Newbie

Joined: Sat Jun 30, 2012 2:54 pm
Posts: 1
<property name="hibernate.connection.autocommit">true</property>
add this line in hibernate.cfg.xml


Top
 Profile  
 
 Post subject: Re: Hibernate not inserting data
PostPosted: Wed Jul 04, 2012 4:23 am 
Newbie

Joined: Wed Jul 04, 2012 4:16 am
Posts: 2
thanks dear this is nice i like it...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.