Hibernate version: 2.1.7c
I am getting an error when I try to update a value on my record and do a saveOrUpdate call on it.
The problem is that I would sweare that this was working before we moved the database files from one system to another and changed our network setup.
[StaleObjectStateException] An operation failed due to stale data.
Thank you,
David Wilson
Mapping documents:
Code:
<?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>
<!--
Created by the Middlegen Hibernate plugin 2.1
http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->
<class
name="com.relevant.util.dao.EstimateCtrRec"
table="jct"
>
<meta attribute="class-description" inherit="false">
@hibernate.class
table="jct"
</meta>
<id
name="jctDiv"
type="java.lang.String"
column="jct_div"
>
<meta attribute="field-description">
@hibernate.id
generator-class="assigned"
type="java.lang.String"
column="jct_div"
</meta>
<generator class="assigned" />
</id>
<version
name="version"
type="int"
column="version"
>
<meta attribute="field-description">
@hibernate.version
column="version"
</meta>
</version>
<property
name="jctLastestno"
type="java.lang.String"
column="jct_lastestno"
not-null="true"
length="6"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lastestno"
length="6"
not-null="true"
</meta>
</property>
<property
name="jctAutoadde"
type="java.lang.String"
column="jct_autoadde"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_autoadde"
length="1"
not-null="true"
</meta>
</property>
<property
name="jctBasedaysoffst"
type="short"
column="jct_basedaysoffst"
not-null="true"
length="5"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_basedaysoffst"
length="5"
not-null="true"
</meta>
</property>
<property
name="jctDfltduedteind"
type="java.lang.String"
column="jct_dfltduedteind"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_dfltduedteind"
length="1"
not-null="true"
</meta>
</property>
<property
name="jctOediv"
type="java.lang.String"
column="jct_oediv"
not-null="true"
length="2"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_oediv"
length="2"
not-null="true"
</meta>
</property>
<property
name="jctInvdiv"
type="java.lang.String"
column="jct_invdiv"
not-null="true"
length="2"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_invdiv"
length="2"
not-null="true"
</meta>
</property>
<property
name="jctDfltodcid"
type="java.lang.String"
column="jct_dfltodcid"
not-null="true"
length="3"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_dfltodcid"
length="3"
not-null="true"
</meta>
</property>
<property
name="jctCo"
type="java.lang.String"
column="jct_co"
not-null="true"
length="6"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_co"
length="6"
not-null="true"
</meta>
</property>
<property
name="jctLnmnd"
type="java.lang.String"
column="jct_lnmnd"
not-null="true"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lnmnd"
length="1"
not-null="true"
</meta>
</property>
<property
name="jctLmdte"
type="java.sql.Timestamp"
column="jct_lmdte"
length="23"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lmdte"
length="23"
</meta>
</property>
<property
name="jctMsgno"
type="int"
column="jct_msgno"
not-null="true"
length="10"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_msgno"
length="10"
not-null="true"
</meta>
</property>
<property
name="jctMtlprcfctr"
type="java.math.BigDecimal"
column="jct_mtlprcfctr"
length="22"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_mtlprcfctr"
length="22"
</meta>
</property>
<property
name="jctLabprcfctr"
type="java.math.BigDecimal"
column="jct_labprcfctr"
length="22"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_labprcfctr"
length="22"
</meta>
</property>
<property
name="jctOhdprcfctr"
type="java.math.BigDecimal"
column="jct_ohdprcfctr"
length="22"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_ohdprcfctr"
length="22"
</meta>
</property>
<property
name="jctSubprcfctr"
type="java.math.BigDecimal"
column="jct_subprcfctr"
length="22"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_subprcfctr"
length="22"
</meta>
</property>
<property
name="jctWbsacctflag"
type="java.lang.String"
column="jct_wbsacctflag"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_wbsacctflag"
length="1"
</meta>
</property>
<property
name="jctMtlcostopt"
type="java.lang.String"
column="jct_mtlcostopt"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_mtlcostopt"
length="1"
</meta>
</property>
<property
name="jctLstbidreqno"
type="java.lang.String"
column="jct_lstbidreqno"
length="8"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstbidreqno"
length="8"
</meta>
</property>
<property
name="jctLstreqno"
type="java.lang.String"
column="jct_lstreqno"
length="7"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstreqno"
length="7"
</meta>
</property>
<property
name="jctLstreqpfx"
type="java.lang.String"
column="jct_lstreqpfx"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstreqpfx"
length="1"
</meta>
</property>
<property
name="jctLstbidno"
type="java.lang.String"
column="jct_lstbidno"
length="7"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstbidno"
length="7"
</meta>
</property>
<property
name="jctLstbidpfx"
type="java.lang.String"
column="jct_lstbidpfx"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstbidpfx"
length="1"
</meta>
</property>
<property
name="jctLstwono"
type="java.lang.String"
column="jct_lstwono"
length="7"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstwono"
length="7"
</meta>
</property>
<property
name="jctLstwopfx"
type="java.lang.String"
column="jct_lstwopfx"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstwopfx"
length="1"
</meta>
</property>
<property
name="jctLstcapno"
type="java.lang.String"
column="jct_lstcapno"
length="7"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstcapno"
length="7"
</meta>
</property>
<property
name="jctLstcappfx"
type="java.lang.String"
column="jct_lstcappfx"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lstcappfx"
length="1"
</meta>
</property>
<property
name="jctAutoaddj"
type="java.lang.String"
column="jct_autoaddj"
length="1"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_autoaddj"
length="1"
</meta>
</property>
<property
name="jctLastjobno"
type="java.lang.String"
column="jct_lastjobno"
length="6"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="jct_lastjobno"
length="6"
</meta>
</property>
<!-- Associations -->
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Code:
public Integer testNextAvailableEstNum(String division) {
Session session = getSession();
Transaction tx = null;
int lastNum= 0;
Integer res = null;
int div = -1;
try {
tx= session.beginTransaction();
Query q= null;
q = session.createQuery(
"select ctr from " +
" EstimateCtrRec ctr" +
" where ctr.jctDiv=:div"
);
q.setString("div", division);
EstimateCtrRec ctr = (EstimateCtrRec) q.uniqueResult();
lastNum= new Integer(ctr.getJctLastestno().trim()).intValue();
logger.error("ctr == " + ctr + "\n\t version = " + ctr.getVersion());
//Save the last estimate number back to the control rec. This is
//how INFIMACS does it.
ctr.setJctLastestno(new Integer(lastNum).toString());
session.saveOrUpdate(ctr);
logger.error("after setting lastEstno version == " + ctr.getVersion() + "\n\tctr == " + ctr);
tx.commit();
res = new Integer(lastNum);
}
catch (HibernateException e) {
e.printStackTrace();
setErrorMessage(e.getMessage());
res = null;
if (tx!=null){ try{ tx.rollback(); } catch(Exception ex) {} }
}
finally {
closeSession();
}
return res;
}
Full stack trace of any exception that occurs:Code:
11:22:08,868 DEBUG [SessionImpl] opened session
11:22:08,868 DEBUG [JTATransaction] Looking for UserTransaction under: UserTransaction
11:22:08,868 DEBUG [JTATransaction] Obtained UserTransaction
11:22:08,868 DEBUG [SessionImpl] find: select ctr from EstimateCtrRec ctr where ctr.jctDiv=:div
11:22:08,868 DEBUG [QueryParameters] named parameters: {div=10}
11:22:08,869 DEBUG [QueryTranslator] compiling query
11:22:08,885 DEBUG [SessionImpl] flushing session
11:22:08,885 DEBUG [SessionImpl] Flushing entities and processing referenced collections
11:22:08,885 DEBUG [SessionImpl] Processing unreferenced collections
11:22:08,885 DEBUG [SessionImpl] Scheduling collection removes/(re)creates/updates
11:22:08,885 DEBUG [SessionImpl] Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
11:22:08,885 DEBUG [SessionImpl] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
11:22:08,886 DEBUG [SessionImpl] Dont need to execute flush
11:22:08,886 DEBUG [QueryTranslator] HQL: select ctr from com.relevant.util.dao.EstimateCtrRec ctr where ctr.jctDiv=:div
11:22:08,886 DEBUG [QueryTranslator] SQL: select estimatect0_.jct_div as jct_div, estimatect0_.version as version, estimatect0_.jct_lastestno as jct_last3_, estimatect0_.jct_autoadde as jct_auto4_, estimatect0_.jct_basedaysoffst as jct_base5_, estimatect0_.jct_dfltduedteind as jct_dflt6_, estimatect0_.jct_oediv as jct_oediv, estimatect0_.jct_invdiv as jct_invdiv, estimatect0_.jct_dfltodcid as jct_dflt9_, estimatect0_.jct_co as jct_co, estimatect0_.jct_lnmnd as jct_lnmnd, estimatect0_.jct_lmdte as jct_lmdte, estimatect0_.jct_msgno as jct_msgno, estimatect0_.jct_mtlprcfctr as jct_mtl14_, estimatect0_.jct_labprcfctr as jct_lab15_, estimatect0_.jct_ohdprcfctr as jct_ohd16_, estimatect0_.jct_subprcfctr as jct_sub17_, estimatect0_.jct_wbsacctflag as jct_wbs18_, estimatect0_.jct_mtlcostopt as jct_mtl19_, estimatect0_.jct_lstbidreqno as jct_lst20_, estimatect0_.jct_lstreqno as jct_lst21_, estimatect0_.jct_lstreqpfx as jct_lst22_, estimatect0_.jct_lstbidno as jct_lst23_, estimatect0_.jct_lstbidpfx as jct_lst24_, estimatect0_.jct_lstwono as jct_lst25_, estimatect0_.jct_lstwopfx as jct_lst26_, estimatect0_.jct_lstcapno as jct_lst27_, estimatect0_.jct_lstcappfx as jct_lst28_, estimatect0_.jct_autoaddj as jct_aut29_, estimatect0_.jct_lastjobno as jct_las30_ from jct estimatect0_ where (estimatect0_.jct_div=? )
11:22:08,886 DEBUG [BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
11:22:08,886 DEBUG [SQL] select estimatect0_.jct_div as jct_div, estimatect0_.version as version, estimatect0_.jct_lastestno as jct_last3_, estimatect0_.jct_autoadde as jct_auto4_, estimatect0_.jct_basedaysoffst as jct_base5_, estimatect0_.jct_dfltduedteind as jct_dflt6_, estimatect0_.jct_oediv as jct_oediv, estimatect0_.jct_invdiv as jct_invdiv, estimatect0_.jct_dfltodcid as jct_dflt9_, estimatect0_.jct_co as jct_co, estimatect0_.jct_lnmnd as jct_lnmnd, estimatect0_.jct_lmdte as jct_lmdte, estimatect0_.jct_msgno as jct_msgno, estimatect0_.jct_mtlprcfctr as jct_mtl14_, estimatect0_.jct_labprcfctr as jct_lab15_, estimatect0_.jct_ohdprcfctr as jct_ohd16_, estimatect0_.jct_subprcfctr as jct_sub17_, estimatect0_.jct_wbsacctflag as jct_wbs18_, estimatect0_.jct_mtlcostopt as jct_mtl19_, estimatect0_.jct_lstbidreqno as jct_lst20_, estimatect0_.jct_lstreqno as jct_lst21_, estimatect0_.jct_lstreqpfx as jct_lst22_, estimatect0_.jct_lstbidno as jct_lst23_, estimatect0_.jct_lstbidpfx as jct_lst24_, estimatect0_.jct_lstwono as jct_lst25_, estimatect0_.jct_lstwopfx as jct_lst26_, estimatect0_.jct_lstcapno as jct_lst27_, estimatect0_.jct_lstcappfx as jct_lst28_, estimatect0_.jct_autoaddj as jct_aut29_, estimatect0_.jct_lastjobno as jct_las30_ from jct estimatect0_ where (estimatect0_.jct_div=? )
11:22:08,886 INFO [STDOUT] Hibernate: select estimatect0_.jct_div as jct_div, estimatect0_.version as version, estimatect0_.jct_lastestno as jct_last3_, estimatect0_.jct_autoadde as jct_auto4_, estimatect0_.jct_basedaysoffst as jct_base5_, estimatect0_.jct_dfltduedteind as jct_dflt6_, estimatect0_.jct_oediv as jct_oediv, estimatect0_.jct_invdiv as jct_invdiv, estimatect0_.jct_dfltodcid as jct_dflt9_, estimatect0_.jct_co as jct_co, estimatect0_.jct_lnmnd as jct_lnmnd, estimatect0_.jct_lmdte as jct_lmdte, estimatect0_.jct_msgno as jct_msgno, estimatect0_.jct_mtlprcfctr as jct_mtl14_, estimatect0_.jct_labprcfctr as jct_lab15_, estimatect0_.jct_ohdprcfctr as jct_ohd16_, estimatect0_.jct_subprcfctr as jct_sub17_, estimatect0_.jct_wbsacctflag as jct_wbs18_, estimatect0_.jct_mtlcostopt as jct_mtl19_, estimatect0_.jct_lstbidreqno as jct_lst20_, estimatect0_.jct_lstreqno as jct_lst21_, estimatect0_.jct_lstreqpfx as jct_lst22_, estimatect0_.jct_lstbidno as jct_lst23_, estimatect0_.jct_lstbidpfx as jct_lst24_, estimatect0_.jct_lstwono as jct_lst25_, estimatect0_.jct_lstwopfx as jct_lst26_, estimatect0_.jct_lstcapno as jct_lst27_, estimatect0_.jct_lstcappfx as jct_lst28_, estimatect0_.jct_autoaddj as jct_aut29_, estimatect0_.jct_lastjobno as jct_las30_ from jct estimatect0_ where (estimatect0_.jct_div=? )
11:22:08,887 DEBUG [BatcherImpl] preparing statement
11:22:08,887 DEBUG [StringType] binding '10' to parameter: 1
11:22:08,894 DEBUG [Loader] processing result set
11:22:08,895 DEBUG [StringType] returning '10' as column: jct_div
11:22:08,895 DEBUG [Loader] result row: 10
11:22:08,895 DEBUG [Loader] Initializing object from ResultSet: 10
11:22:08,895 DEBUG [Loader] Hydrating entity: com.relevant.util.dao.EstimateCtrRec#10
11:22:08,895 DEBUG [IntegerType] returning '0' as column: version
11:22:08,896 DEBUG [StringType] returning '33 ' as column: jct_last3_
11:22:08,896 DEBUG [StringType] returning 'Y' as column: jct_auto4_
11:22:08,896 DEBUG [ShortType] returning '0' as column: jct_base5_
11:22:08,896 DEBUG [StringType] returning 'N' as column: jct_dflt6_
11:22:08,896 DEBUG [StringType] returning '10' as column: jct_oediv
11:22:08,896 DEBUG [StringType] returning '10' as column: jct_invdiv
11:22:08,896 DEBUG [StringType] returning 'MSC' as column: jct_dflt9_
11:22:08,896 DEBUG [StringType] returning ' ' as column: jct_co
11:22:08,896 DEBUG [StringType] returning 'N' as column: jct_lnmnd
11:22:08,897 DEBUG [TimestampType] returning '2005-04-01 00:00:00' as column: jct_lmdte
11:22:08,897 DEBUG [IntegerType] returning '0' as column: jct_msgno
11:22:08,897 DEBUG [BigDecimalType] returning '0.000000' as column: jct_mtl14_
11:22:08,897 DEBUG [BigDecimalType] returning '0.000000' as column: jct_lab15_
11:22:08,897 DEBUG [BigDecimalType] returning '0.000000' as column: jct_ohd16_
11:22:08,897 DEBUG [BigDecimalType] returning '0.000000' as column: jct_sub17_
11:22:08,898 DEBUG [StringType] returning 'W' as column: jct_wbs18_
11:22:08,898 DEBUG [StringType] returning 'P' as column: jct_mtl19_
11:22:08,898 DEBUG [StringType] returning ' ' as column: jct_lst20_
11:22:08,898 DEBUG [StringType] returning '5 ' as column: jct_lst21_
11:22:08,898 DEBUG [StringType] returning 'E' as column: jct_lst22_
11:22:08,898 DEBUG [StringType] returning ' ' as column: jct_lst23_
11:22:08,898 DEBUG [StringType] returning ' ' as column: jct_lst24_
11:22:08,898 DEBUG [StringType] returning ' ' as column: jct_lst25_
11:22:08,898 DEBUG [StringType] returning ' ' as column: jct_lst26_
11:22:08,898 DEBUG [StringType] returning ' ' as column: jct_lst27_
11:22:08,898 DEBUG [StringType] returning ' ' as column: jct_lst28_
11:22:08,899 DEBUG [StringType] returning 'Y' as column: jct_aut29_
11:22:08,899 DEBUG [StringType] returning '26 ' as column: jct_las30_
11:22:08,899 DEBUG [SessionImpl] Version: 0
11:22:08,899 DEBUG [Loader] done processing result set (1 rows)
11:22:08,899 DEBUG [BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
11:22:08,899 DEBUG [BatcherImpl] closing statement
11:22:08,899 DEBUG [Loader] total objects hydrated: 1
11:22:08,899 DEBUG [SessionImpl] resolving associations for [com.relevant.util.dao.EstimateCtrRec#10]
11:22:08,899 DEBUG [SessionImpl] done materializing entity [com.relevant.util.dao.EstimateCtrRec#10]
11:22:08,899 DEBUG [SessionImpl] initializing non-lazy collections
11:22:08,901 INFO [STDOUT] 11:22:08,901 ERROR [relevant] ctr == com.relevant.util.dao.EstimateCtrRec@10e0edb[jctDiv=10,jctLastestno=33 ,jctAutoadde=Y,jctBasedaysoffst=0,jctDfltduedteind=N,jctOediv=10,jctInvdiv=10,jctDfltodcid=MSC,jctCo= ,jctLnmnd=N,jctLmdte=2005-04-01 00:00:00.0,jctMsgno=0,jctMtlprcfctr=0.000000,jctLabprcfctr=0.000000,jctOhdprcfctr=0.000000,jctSubprcfctr=0.000000,jctWbsacctflag=W,jctMtlcostopt=P,jctLstbidreqno= ,jctLstreqno=5 ,jctLstreqpfx=E,jctLstbidno= ,jctLstbidpfx= ,jctLstwono= ,jctLstwopfx= ,jctLstcapno= ,jctLstcappfx= ,jctAutoaddj=Y,jctLastjobno=26 ]
version = 0
11:22:08,902 DEBUG [SessionImpl] saveOrUpdate() persistent instance
11:22:08,902 INFO [STDOUT] 11:22:08,902 ERROR [relevant] after setting lastEstno version == 0
ctr == com.relevant.util.dao.EstimateCtrRec@10e0edb[jctDiv=10,jctLastestno=33,jctAutoadde=Y,jctBasedaysoffst=0,jctDfltduedteind=N,jctOediv=10,jctInvdiv=10,jctDfltodcid=MSC,jctCo= ,jctLnmnd=N,jctLmdte=2005-04-01 00:00:00.0,jctMsgno=0,jctMtlprcfctr=0.000000,jctLabprcfctr=0.000000,jctOhdprcfctr=0.000000,jctSubprcfctr=0.000000,jctWbsacctflag=W,jctMtlcostopt=P,jctLstbidreqno= ,jctLstreqno=5 ,jctLstreqpfx=E,jctLstbidno= ,jctLstbidpfx= ,jctLstwono= ,jctLstwopfx= ,jctLstcapno= ,jctLstcappfx= ,jctAutoaddj=Y,jctLastjobno=26 ]
11:22:08,903 DEBUG [JTATransaction] commit
11:22:08,903 DEBUG [SessionImpl] flushing session
11:22:08,903 DEBUG [SessionImpl] Flushing entities and processing referenced collections
11:22:08,903 DEBUG [AbstractEntityPersister] com.relevant.util.dao.EstimateCtrRec.jctLastestno is dirty
11:22:08,903 DEBUG [SessionImpl] Updating entity: [com.relevant.util.dao.EstimateCtrRec#10]
11:22:08,903 DEBUG [Versioning] Incrementing: 0 to 1
11:22:08,907 DEBUG [SessionImpl] Processing unreferenced collections
11:22:08,907 DEBUG [SessionImpl] Scheduling collection removes/(re)creates/updates
11:22:08,907 DEBUG [SessionImpl] Flushed: 0 insertions, 1 updates, 0 deletions to 1 objects
11:22:08,907 DEBUG [SessionImpl] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
11:22:08,907 DEBUG [Printer] listing entities:
11:22:08,908 DEBUG [Printer] com.relevant.util.dao.EstimateCtrRec{jctLastjobno=26 , jctLstbidreqno= , jctMtlcostopt=P, jctLstreqpfx=E, jctDfltodcid=MSC, jctLastestno=33, jctAutoaddj=Y, jctAutoadde=Y, jctCo= , jctLstbidpfx= , jctLstwopfx= , jctMsgno=0, jctLnmnd=N, jctLstreqno=5 , jctDiv=10, jctLstbidno= , jctBasedaysoffst=0, jctLstwono= , jctInvdiv=10, jctLmdte=2005-04-01 00:00:00, version=0, jctWbsacctflag=W, jctDfltduedteind=N, jctSubprcfctr=0.000000, jctOhdprcfctr=0.000000, jctLabprcfctr=0.000000, jctLstcapno= , jctMtlprcfctr=0.000000, jctOediv=10, jctLstcappfx= }
11:22:08,908 DEBUG [SessionImpl] executing flush
11:22:08,908 DEBUG [EntityPersister] Updating entity: [com.relevant.util.dao.EstimateCtrRec#10]
11:22:08,908 DEBUG [EntityPersister] Existing version: 0 -> New version: 1
11:22:08,909 DEBUG [BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
11:22:08,911 DEBUG [SQL] update jct set version=?, jct_lastestno=?, jct_autoadde=?, jct_basedaysoffst=?, jct_dfltduedteind=?, jct_oediv=?, jct_invdiv=?, jct_dfltodcid=?, jct_co=?, jct_lnmnd=?, jct_lmdte=?, jct_msgno=?, jct_mtlprcfctr=?, jct_labprcfctr=?, jct_ohdprcfctr=?, jct_subprcfctr=?, jct_wbsacctflag=?, jct_mtlcostopt=?, jct_lstbidreqno=?, jct_lstreqno=?, jct_lstreqpfx=?, jct_lstbidno=?, jct_lstbidpfx=?, jct_lstwono=?, jct_lstwopfx=?, jct_lstcapno=?, jct_lstcappfx=?, jct_autoaddj=?, jct_lastjobno=? where jct_div=? and version=?
11:22:08,911 INFO [STDOUT] Hibernate: update jct set version=?, jct_lastestno=?, jct_autoadde=?, jct_basedaysoffst=?, jct_dfltduedteind=?, jct_oediv=?, jct_invdiv=?, jct_dfltodcid=?, jct_co=?, jct_lnmnd=?, jct_lmdte=?, jct_msgno=?, jct_mtlprcfctr=?, jct_labprcfctr=?, jct_ohdprcfctr=?, jct_subprcfctr=?, jct_wbsacctflag=?, jct_mtlcostopt=?, jct_lstbidreqno=?, jct_lstreqno=?, jct_lstreqpfx=?, jct_lstbidno=?, jct_lstbidpfx=?, jct_lstwono=?, jct_lstwopfx=?, jct_lstcapno=?, jct_lstcappfx=?, jct_autoaddj=?, jct_lastjobno=? where jct_div=? and version=?
11:22:08,911 DEBUG [BatcherImpl] preparing statement
11:22:08,911 DEBUG [EntityPersister] Dehydrating entity: [com.relevant.util.dao.EstimateCtrRec#10]
11:22:08,911 DEBUG [IntegerType] binding '1' to parameter: 1
11:22:08,912 DEBUG [StringType] binding '33' to parameter: 2
11:22:08,912 DEBUG [StringType] binding 'Y' to parameter: 3
11:22:08,912 DEBUG [ShortType] binding '0' to parameter: 4
11:22:08,912 DEBUG [StringType] binding 'N' to parameter: 5
11:22:08,912 DEBUG [StringType] binding '10' to parameter: 6
11:22:08,912 DEBUG [StringType] binding '10' to parameter: 7
11:22:08,912 DEBUG [StringType] binding 'MSC' to parameter: 8
11:22:08,912 DEBUG [StringType] binding ' ' to parameter: 9
11:22:08,912 DEBUG [StringType] binding 'N' to parameter: 10
11:22:08,913 DEBUG [TimestampType] binding '2005-04-01 00:00:00' to parameter: 11
11:22:08,913 DEBUG [IntegerType] binding '0' to parameter: 12
11:22:08,913 DEBUG [BigDecimalType] binding '0.000000' to parameter: 13
11:22:08,913 DEBUG [BigDecimalType] binding '0.000000' to parameter: 14
11:22:08,913 DEBUG [BigDecimalType] binding '0.000000' to parameter: 15
11:22:08,913 DEBUG [BigDecimalType] binding '0.000000' to parameter: 16
11:22:08,913 DEBUG [StringType] binding 'W' to parameter: 17
11:22:08,913 DEBUG [StringType] binding 'P' to parameter: 18
11:22:08,913 DEBUG [StringType] binding ' ' to parameter: 19
11:22:08,914 DEBUG [StringType] binding '5 ' to parameter: 20
11:22:08,914 DEBUG [StringType] binding 'E' to parameter: 21
11:22:08,914 DEBUG [StringType] binding ' ' to parameter: 22
11:22:08,914 DEBUG [StringType] binding ' ' to parameter: 23
11:22:08,914 DEBUG [StringType] binding ' ' to parameter: 24
11:22:08,914 DEBUG [StringType] binding ' ' to parameter: 25
11:22:08,914 DEBUG [StringType] binding ' ' to parameter: 26
11:22:08,914 DEBUG [StringType] binding ' ' to parameter: 27
11:22:08,914 DEBUG [StringType] binding 'Y' to parameter: 28
11:22:08,914 DEBUG [StringType] binding '26 ' to parameter: 29
11:22:08,914 DEBUG [StringType] binding '10' to parameter: 30
11:22:08,914 DEBUG [IntegerType] binding '0' to parameter: 31
11:22:08,935 WARN [StaleObjectStateException] An operation failed due to stale data
net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for com.relevant.util.dao.EstimateCtrRec instance with identifier: 10
at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:514)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:666)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:623)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2438)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2260)
at net.sf.hibernate.transaction.JTATransaction.commit(JTATransaction.java:52)
at com.relevant.E3.ejb.estimate.EstimateBO.testNextAvailableEstNum(EstimateBO.java:1802)
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:585)
at com.relevant.E3.ejb.businesscontroller.BCSessionBean.execute(BCSessionBean.java:232)
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:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:584)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:123)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:294)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:870)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
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:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
11:22:08,970 DEBUG [BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
11:22:08,970 DEBUG [BatcherImpl] closing statement
11:22:08,970 ERROR [SessionImpl] Could not synchronize database state with session
11:22:08,972 INFO [STDOUT] net.sf.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) for com.relevant.util.dao.EstimateCtrRec instance with identifier: 10
at net.sf.hibernate.persister.AbstractEntityPersister.check(AbstractEntityPersister.java:514)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:666)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:623)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2438)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2260)
at net.sf.hibernate.transaction.JTATransaction.commit(JTATransaction.java:52)
at com.relevant.E3.ejb.estimate.EstimateBO.testNextAvailableEstNum(EstimateBO.java:1802)
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:585)
at com.relevant.E3.ejb.businesscontroller.BCSessionBean.execute(BCSessionBean.java:232)
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:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:584)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:123)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:294)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:313)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:146)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:870)
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:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
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:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
11:22:08,977 DEBUG [JTATransaction] rollback
11:22:08,978 DEBUG [SessionImpl] closing session
11:22:08,978 DEBUG [SessionImpl] disconnecting session
11:22:08,985 DEBUG [CacheSynchronization] transaction after completion callback, status: 4
11:22:08,985 DEBUG [SessionImpl] transaction completion
11:22:08,985 DEBUG [CacheSynchronization] transaction after completion callback, status: 4
11:22:08,985 DEBUG [SessionImpl] transaction completion
Name and version of the database you are using: MS SQL 2000 and using JTDS-0.9-rc2
Database connection setting is:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>MSSQLDS</jndi-name>
<connection-url>jdbc:jtds:sqlserver://sql2003:1433/E3Proto;SelectMethod=cursor</connection-url>
<!--
<connection-url>jdbc:jtds:sqlserver://sql2003:1433/E3Proto;SelectMethod=cursor;tds=8.0;lastupdatecount=true</connection-url>
<connection-url>jdbc:jtds:sqlserver://sql2003:1433/E3;SelectMethod=cursor;tds=8.0;lastupdatecount=true</connection-url>
<connection-url>jdbc:jtds:sqlserver://muttley:1433/patbiz</connection-url>
-->
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
<user-name>tssqlq</user-name>
<password>infinf</password>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- Use the security domain defined in conf/login-config.xml -->
<!--
<security-domain>E3Realm</security-domain>
-->
<!-- Use the security domain defined in conf/login-config.xml or the
getConnection(user, pw) for logins. The security domain takes precedence.
<security-domain-and-application>MSSqlDbRealm</security-domain-and-application>
-->
<!--
sql to call on an existing pooled connection when it is obtained from pool
-->
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
</local-tx-datasource>
</datasources>