Need help with Hibernate? Read this first:
http://
when i update a record of ImageTable object,the data has been updated in database,the fields version has plus 1 automatic (i use version in hbm file), but when my application run ,it found the exceptions still as follows:
Code:
Hibernate: update ImagesTable set version=?, objectType=?, objectID=?, MAP=?, DEVICETAB=?, maxID=?, LOCKED=?, parentID=? where ID=? and version=?
2005-10-20 16:54:35 org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator close
error: Could not free Oracle LOB
java.sql.SQLException: must logging on server
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
at oracle.jdbc.ttc7.TTC7Protocol.assertLoggedIn(TTC7Protocol.java:2199)
at oracle.jdbc.ttc7.TTC7Protocol.freeTemporaryLob(TTC7Protocol.java:3254)
at oracle.sql.LobDBAccessImpl.freeTemporary(LobDBAccessImpl.java:378)
at oracle.sql.BLOB.freeTemporary(BLOB.java:851)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.close(OracleLobHandler.java:397)
at org.springframework.orm.hibernate.support.AbstractLobType$SpringLobCreatorSynchronization.beforeCompletion(AbstractLobType.java:242)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCompletion(AbstractPlatformTransactionManager.java:542)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:387)
at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:243)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy10.saveMapCache(Unknown Source)
at com.jctx.trms.hibernate.bussiness.CacheManager.commitCacheData(CacheManager.java:86)
at com.jctx.trms.cache.MapCache.save2DB(MapCache.java:552)
at com.jctx.trms.actions.SaveAction.run(SaveAction.java:61)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at com.jctx.trms.TrmsApplication.run(TrmsApplication.java:14)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
2005-10-20 16:54:35 org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator close
error: Could not free Oracle LOB
java.sql.SQLException: must logging on server
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
at oracle.jdbc.ttc7.TTC7Protocol.assertLoggedIn(TTC7Protocol.java:2199)
at oracle.jdbc.ttc7.TTC7Protocol.freeTemporaryLob(TTC7Protocol.java:3254)
at oracle.sql.LobDBAccessImpl.freeTemporary(LobDBAccessImpl.java:378)
at oracle.sql.BLOB.freeTemporary(BLOB.java:851)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.springframework.jdbc.support.lob.OracleLobHandler$OracleLobCreator.close(OracleLobHandler.java:397)
at org.springframework.orm.hibernate.support.AbstractLobType$SpringLobCreatorSynchronization.beforeCompletion(AbstractLobType.java:242)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCompletion(AbstractPlatformTransactionManager.java:542)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:387)
at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:243)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
at $Proxy10.saveMapCache(Unknown Source)
at com.jctx.trms.hibernate.bussiness.CacheManager.commitCacheData(CacheManager.java:86)
at com.jctx.trms.cache.MapCache.save2DB(MapCache.java:552)
at com.jctx.trms.actions.SaveAction.run(SaveAction.java:61)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at com.jctx.trms.TrmsApplication.run(TrmsApplication.java:14)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
i have use byte[] type and version in my ImageTable.hbm.xml,the ImageTable.hbm.xml file as follows:Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.jctx.trms.hibernate.persistence.transequip.ImagesTable"
table="ImagesTable"
dynamic-insert = "false"
dynamic-update = "false"
optimistic-lock="version"
>
<id name="ID"
type="java.lang.Long"
column="ID"
unsaved-value="null">
<generator class="sequence">
<param name="sequence">imagetable_sequence</param>
</generator>
</id>
<version name="version"
type="java.lang.Long"
column="version"
unsaved-value="null"
/>
<property name="objectType"
type="java.lang.String"
column="objectType"
not-null="false" />
<property name="objectID"
type="java.lang.Long"
column="objectID"
not-null="false" />
<property name="map"
type="org.springframework.orm.hibernate.support.BlobByteArrayType"
column="MAP"
not-null="false"/>
<property name="deviceTab"
type="org.springframework.orm.hibernate.support.BlobByteArrayType"
column="DEVICETAB"
not-null="false"/>
<property name="maxID"
type="java.lang.Long"
column="maxID"
not-null="false" />
<property name="locked"
type="java.lang.Integer"
column="LOCKED"
not-null="false" />
<property name="parentID"
type="java.lang.Long"
column="parentID"
not-null="false" />
</class>
</hibernate-mapping>
my persistence class ImageTable.java as follows:Code:
import com.jctx.trms.hibernate.persistence.BaseObject;
/**
*
* @author zjsong
*/
public class ImagesTable extends BaseObject {
public Long ID;
public String objectType;
public Long objectID;
public byte[] map;
public byte[] deviceTab;
public Long maxID;
public Integer locked; //locked 0:unlock 1:lock
public Long version; //version
public Long parentID;
public ImagesTable() {
}
public byte[] getDeviceTab() {
return deviceTab;
}
public void setDeviceTab(byte[] deviceTab) {
this.deviceTab = deviceTab;
}
public Long getID() {
return ID;
}
public void setID(Long id) {
ID = id;
}
public Integer getLocked() {
return locked;
}
public void setLocked(Integer locked) {
this.locked = locked;
}
public byte[] getMap() {
return map;
}
public void setMap(byte[] map) {
this.map = map;
}
public Long getMaxID() {
return maxID;
}
public void setMaxID(Long maxID) {
this.maxID = maxID;
}
public Long getObjectID() {
return objectID;
}
public void setObjectID(Long objectID) {
this.objectID = objectID;
}
public String getObjectType() {
return objectType;
}
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
public Long getParentID() {
return parentID;
}
public void setParentID(Long parentID) {
this.parentID = parentID;
}
}
can anyone help me solve the problem? many thanks!