-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate insert problem
PostPosted: Thu Aug 28, 2008 11:41 pm 
Newbie

Joined: Wed Aug 27, 2008 4:20 pm
Posts: 3
I am enable to insert the this data to the data base
i am able to to it with other table .


Code between sessionFactory.openSession() and session.close():
Session hsession =null;

try{
log.debug("hibernate test one called");
EmsPoll emsPoll = new EmsPoll();
Date startdate = new Date(System.currentTimeMillis());
Date enddate = new Date(System.currentTimeMillis());

byte s = 1;
emsPoll.setEmsUuid("1000017");
emsPoll.setSuccess(s);
emsPoll.setLastState("Testing");
emsPoll.setStartTime(startdate);
emsPoll.setEndTime(enddate);
hsession = sessionFactory.getCurrentSession();
log.debug("log for testign the insert in to Atp Table:");
hsession.save(emsPoll);
Full stack trace of any exception that occurs:
[org.jboss.resource.connectionmanager.TxConnectionManager] Connection error occured: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@447828[state=NORMAL mc=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@15d9ee6 handles=1 lastUse=1219959577812 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@1923700 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@590ff7 xaResource=org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@15d9ee6 txSync=null]
java.lang.NullPointerException

and info statment from hibernate code
[org.hibernate.type.StringType] could not bind value '1000017' to parameter: 1; Error; - nested throwable: (java.lang.NullPointerException)

Name and version of the database you are using:
mysql 5.4
The generated SQL (show_sql=true):
insert into bms.ems_poll (ems_uuid, success, last_state, start_time, end_time) values (?, ?, ?, ?, ?)

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html



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

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.