I am getting this expcetion, when trying to insert a simple statement into SQL Server2000 with hibrante-mapping for ID generator class as [b]identity or native[/b] from a [b]Websphere container [/b]either with a Webspehere embedded JDBC driver or JTDC driver for SQLServer.
From outside the container it works fine either with Microsoft or JTDC drivers. But with Webspehere embedded JDBC driver it gives [i]Unsupported method: Connection.prepareStatement[/i] exception.
Additional information :
1. I have seen it working okay even in the container with JTDC drivers, but using DBCP connection pooling.
2. It works okay in the container for generator class="increment"
3. I see this log statement just before the expcetion ?!!
30 Mar 2007 10:27:53,344 INFO org.hibernate.type.StringType - could not bind value 'sdffasdf' to parameter: 1; null
This same issue was posted, wayback in 2005 but ended up with no resolution. Appreciate any insight into this issue.
[b]Hibernate version:[/b]
3.0.5, 3.1.2, 3.2.2
[b]Mapping documents:[/b]
<hibernate-mapping package="com.hcsc.eppsrw.integration.dto">
<class name="DemoDTO" table="DEMO">
<id name="id" column="ID" type="long" unsaved-value="undefined">
<generator class="identity" />
</id>
<property name="name" length="20"/>
<property name="description" />
<property name="status" />
</class>
</hibernate-mapping>
[b]Code between sessionFactory.openSession() and session.close():[/b]
public void save(DemoDTO demoDto) {
getHibernateTemplate().save(demoDto);
}
[b]Full stack trace of any exception that occurs:[/b]
Caused by: java.lang.NullPointerException
at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:471)
at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:218)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1981)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:530)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:518)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:514)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:625)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:622)
[b]Name and version of the database you are using:[/b]
Microsoft SQLServer2000
|