-->
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.  [ 6 posts ] 
Author Message
 Post subject: HIbernate with DB2 database - problem with insert / update
PostPosted: Thu Jan 26, 2006 2:06 am 
Newbie

Joined: Thu Jan 26, 2006 1:54 am
Posts: 4
My environment is as follows: Java 1.4.x, Hibernate 2, DB2 Database.

Table definition:

CREATE TABLE service_category (
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY,
name VARCHAR(255) default NULL,
description BLOB(65K),
parent_id BIGINT default 1,
update_date TIMESTAMP NOT NULL,
create_date TIMESTAMP NOT NULL default CURRENT TIMESTAMP,
update_user VARCHAR(32) default 'admin',
create_user VARCHAR(32) default 'admin',
enabled_flag CHAR(1) default 'Y',
PRIMARY KEY (id)
);

Object definition:

public class ServiceCategory implements Serializable, Cloneable {

private long id;
private long parentId;
private String name;
private String description;

// book-keeping fields
private Date createDate;
private Date updateDate;

....

Hibernate map file definition:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class name="com.myco.framework.registry.ServiceCategory" table="service_category">
<id name="id" column="id" type="java.lang.Long" unsaved-value="0">
<generator class="native"/>
</id>
<property name="parentId" column="parent_id" type="java.lang.Long"/>
<property name="name" column="name" type="java.lang.String"/>
<property name="description" column="description" type="java.lang.String"/>
<property name="createDate" column="create_date" type="java.util.Date"/>
<property name="updateDate" column="update_date" type="java.util.Date"/>
</class>
</hibernate-mapping>

=====

Now, I am able to query this table successfully but don't seem to be able to write to it. Please note that the exact same code seems to be working perfectly with a MySql backend and fails when I try to get the same code working against DB2. Anyone face similar issues? Please let me know what I can do to get past this situation.

Here are the traces:

EXCEPTION DURING INSERT OF AN OBJECT
=====================================

[1/26/06 3:17:00:973 PST] 0000003e SystemOut O Hibernate: insert into service_category (parent_id, name, description, create_date, update_date) values (?, ?, ?, ?, ?)
[1/26/06 3:17:00:975 PST] 0000003e JDBCException W SQL Error: -99999, SQLState: null
[1/26/06 3:17:00:976 PST] 0000003e JDBCException E Illegal Conversion
[1/26/06 3:17:00:977 PST] 0000003e JDBCException W SQL Error: -99999, SQLState: null
[1/26/06 3:17:00:979 PST] 0000003e JDBCException E Illegal Conversion
[1/26/06 3:17:00:980 PST] 0000003e JDBCException E could not insert: [com.myco.framework.registry.ServiceCategory]
[1/26/06 3:17:00:983 PST] 0000003e JDBCException E TRAS0014I: The following exception was logged com.ibm.db2.jcc.b.SqlException: Illegal Conversion
at com.ibm.db2.jcc.b.q.a(q.java:677)
at com.ibm.db2.jcc.b.q.a(q.java:1204)
at com.ibm.db2.jcc.b.jd.a(jd.java:1235)
at com.ibm.db2.jcc.b.jd.lb(jd.java:3194)
at com.ibm.db2.jcc.b.jd.a(jd.java:1997)
at com.ibm.db2.jcc.b.jd.a(jd.java:2424)
at com.ibm.db2.jcc.b.jd.W(jd.java:537)
at com.ibm.db2.jcc.b.jd.executeUpdate(jd.java:520)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:528)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:932)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at com.myco.framework.dbconnector.DBConnectorImpl.create(Unknown Source)
at com.myco.framework.dbconnector.GenericDao.create(Unknown Source)
at com.myco.admin.AddServiceCategoryAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
.
com.ibm.db2.jcc.b.SqlException: Illegal Conversion
at com.ibm.db2.jcc.b.q.a(q.java:677)
at com.ibm.db2.jcc.b.q.a(q.java:1204)
at com.ibm.db2.jcc.b.jd.a(jd.java:1235)
at com.ibm.db2.jcc.b.jd.lb(jd.java:3194)
at com.ibm.db2.jcc.b.jd.a(jd.java:1997)
at com.ibm.db2.jcc.b.jd.a(jd.java:2424)
at com.ibm.db2.jcc.b.jd.W(jd.java:537)
at com.ibm.db2.jcc.b.jd.executeUpdate(jd.java:520)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:528)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:432)
at net.sf.hibernate.impl.ScheduledIdentityInsertion.execute(ScheduledIdentityInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:932)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:775)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at com.myco.framework.dbconnector.DBConnectorImpl.create(Unknown Source)
at com.myco.framework.dbconnector.GenericDao.create(Unknown Source)
at com.myco.admin.AddServiceCategoryAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:80)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1657)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:94)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)

[1/26/06 3:17:00:985 PST] 0000003e dbconnector E Exception in DBConnector.create:
could not insert: [com.myco.framework.registry.ServiceCategory]


=======================================================================================

EXCEPTION DURING UPDATE OF AN OBJECT
====================================

[1/26/06 3:14:24:968 PST] 00000040 dbconnector I Hibernate DB Session is valid: net.sf.hibernate.impl.SessionImpl@250f44ba
[1/26/06 3:14:25:049 PST] 00000040 SystemOut O Hibernate: update server_deployment_settings set console_host=?, console_port=?, gateway_host=?, gateway_port=?, http_proxy_host=?, http_proxy_port=?, mail_host=?, mail_smtp_auth=?, mail_user=?, mail_password=?, mail_sender=?, create_date=?, update_date=? where id=?
[1/26/06 3:14:25:062 PST] 00000040 JDBCException W SQL Error: -407, SQLState: 23502
[1/26/06 3:14:25:064 PST] 00000040 JDBCException E DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=50, COLNO=13
[1/26/06 3:14:25:065 PST] 00000040 JDBCException E could not update: [com.myco.framework.registry.ServerDeploymentSettings#1]
[1/26/06 3:14:25:068 PST] 00000040 JDBCException E TRAS0014I: The following exception was logged com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=50, COLNO=13
at com.ibm.db2.jcc.b.id.d(id.java:1385)
at com.ibm.db2.jcc.c.fb.l(fb.java:366)
at com.ibm.db2.jcc.c.fb.a(fb.java:64)
at com.ibm.db2.jcc.c.s.a(s.java:48)
at com.ibm.db2.jcc.c.xb.c(xb.java:266)
at com.ibm.db2.jcc.b.jd.ab(jd.java:1684)
at com.ibm.db2.jcc.b.jd.a(jd.java:2253)
at com.ibm.db2.jcc.b.jd.W(jd.java:537)
at com.ibm.db2.jcc.b.jd.executeUpdate(jd.java:520)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:689)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2368)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at com.myco.framework.dbconnector.DBConnectorImpl.update(Unknown Source)
at com.myco.framework.dbconnector.GenericDao.update(Unknown Source)
at com.myco.admin.AddServerDeploymentSettingsAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
.
com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=50, COLNO=13
at com.ibm.db2.jcc.b.id.d(id.java:1385)
at com.ibm.db2.jcc.c.fb.l(fb.java:366)
at com.ibm.db2.jcc.c.fb.a(fb.java:64)
at com.ibm.db2.jcc.c.s.a(s.java:48)
at com.ibm.db2.jcc.c.xb.c(xb.java:266)
at com.ibm.db2.jcc.b.jd.ab(jd.java:1684)
at com.ibm.db2.jcc.b.jd.a(jd.java:2253)
at com.ibm.db2.jcc.b.jd.W(jd.java:537)
at com.ibm.db2.jcc.b.jd.executeUpdate(jd.java:520)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:689)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2368)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at com.myco.framework.dbconnector.DBConnectorImpl.update(Unknown Source)
at com.myco.framework.dbconnector.GenericDao.update(Unknown Source)
at com.myco.admin.AddServerDeploymentSettingsAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)

[1/26/06 3:14:25:070 PST] 00000040 SessionImpl E Could not synchronize database state with session
[1/26/06 3:14:25:080 PST] 00000040 SessionImpl E TRAS0014I: The following exception was logged net.sf.hibernate.JDBCException: could not update: [com.myco.framework.registry.ServerDeploymentSettings#1]
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:707)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2368)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at com.myco.framework.dbconnector.DBConnectorImpl.update(Unknown Source)
at com.myco.framework.dbconnector.GenericDao.update(Unknown Source)
at com.myco.admin.AddServerDeploymentSettingsAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=50, COLNO=13
at com.ibm.db2.jcc.b.id.d(id.java:1385)
at com.ibm.db2.jcc.c.fb.l(fb.java:366)
at com.ibm.db2.jcc.c.fb.a(fb.java:64)
at com.ibm.db2.jcc.c.s.a(s.java:48)
at com.ibm.db2.jcc.c.xb.c(xb.java:266)
at com.ibm.db2.jcc.b.jd.ab(jd.java:1684)
at com.ibm.db2.jcc.b.jd.a(jd.java:2253)
at com.ibm.db2.jcc.b.jd.W(jd.java:537)
at com.ibm.db2.jcc.b.jd.executeUpdate(jd.java:520)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:689)
... 31 more
.
net.sf.hibernate.JDBCException: could not update: [com.myco.framework.registry.ServerDeploymentSettings#1]
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:707)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2368)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
at com.myco.framework.dbconnector.DBConnectorImpl.update(Unknown Source)
at com.myco.framework.dbconnector.GenericDao.update(Unknown Source)
at com.myco.admin.AddServerDeploymentSettingsAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1212)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1681)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:77)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:421)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:367)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminaters(NewConnectionInitialReadCallback.java:201)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:103)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:548)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:601)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:934)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1021)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)
Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=50, COLNO=13
at com.ibm.db2.jcc.b.id.d(id.java:1385)
at com.ibm.db2.jcc.c.fb.l(fb.java:366)
at com.ibm.db2.jcc.c.fb.a(fb.java:64)
at com.ibm.db2.jcc.c.s.a(s.java:48)
at com.ibm.db2.jcc.c.xb.c(xb.java:266)
at com.ibm.db2.jcc.b.jd.ab(jd.java:1684)
at com.ibm.db2.jcc.b.jd.a(jd.java:2253)
at com.ibm.db2.jcc.b.jd.W(jd.java:537)
at com.ibm.db2.jcc.b.jd.executeUpdate(jd.java:520)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:22)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:689)
... 31 more

[1/26/06 3:14:25:083 PST] 00000040 dbconnector E Exception in DBConnector.update:
could not update: [com.myco.framework.registry.ServerDeploymentSettings#1]

=====

Thanks much,
Ron


Last edited by soactive on Thu Jan 26, 2006 3:41 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 7:10 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Does the SQL that hibernate generates work at the db2 command line ?

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 3:23 pm 
Newbie

Joined: Thu Jan 26, 2006 1:54 am
Posts: 4
Yes. It does work from the command line.

Can someone please provide any ideas that may help to fix this issue.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:47 pm 
Beginner
Beginner

Joined: Thu May 26, 2005 12:31 pm
Posts: 25
An insert or update value could be null, but the column cannot contain null values. please check that..

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 7:06 pm 
Newbie

Joined: Thu Jan 26, 2006 1:54 am
Posts: 4
Thanks for your reply. I checked and made sure that none of the values being inserted are NULL. Now, I am having a different problem. The 'update' does not throw an exception but the values don't get inserted either. Does it expect me to 'commit' the transaction. In fact I even tried to do:
session.getConnection().commit() and that doesn't update the record in the db either - nor does it throw any exception.

Any thoughts/ideas would be greatly appreciated.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 4:04 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
Code:
session.getConnection().commit()


Should work I think.
Better ist

Code:
Transaction tx = session.beginTransaction();

// do your work

tx.commit();
// or session.getTransaction().commit();

_________________
dont forget to rate !


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.