Thought inc.

The Dynamic O/R Mapping Company
     

CocoBase Technical Support Forums
For access to developer site with software download and doc's, please request CocoBase download and password
will be emailed to you. Response to posts will appear when answered by THOUGHT Support team.
NOTE:You must register separately with forum in order to post your questions, please click on register icon below.
Home   Frequently Asked Questions   Search   Edit your profile   Registration is free!  
Email This Page to Someone!
Show a Printable Version
CocoBase Enterprise O/R Forums > CocoBase Questions
INVALIDSTATE_ERROR
< Previous Thread     Next Thread >
Author
Thread    Post New Thread     Post A Reply
vmongs
Member

Registered: May 2007
Posts: 1

Hello support Team,

I am new to cocobase and was trying to insert the data into the table "country_list" in my database . I am using ms-sql.
But it gives this INVALIDSTATE_ERROR.

+++++++++++++++++++++++++++++++++++++++++
com.mycompany.common.lib.ServiceException
Message: Exception occurs in Inserting Contry
Code: 0
InnerException:
+++++++++++++++++++++++++++++++++++++++++
Exception: com.mycompany.common.lib.ApplicationException
Message: create():

InnerException: thought.CocoBase.CBFacadeException: Cannot commit changes; session invalid
error code: INVALIDSTATE_ERROR
detail message: thought.CocoBase.CocoBaseException: CBMessage=Insert failed in Database SQL.

obj=CocoProxyM:toString: WrapperedClass=com.mycompany.myproject.biz.Country hashCode=1669206954 contents= id=-1 countryName=INDIA countryNumber=IND foreign keys={}CoreMessage=[IBM][SQLServer JDBC Driver][SQLServer]Statement(s) could not be prepared. CocoBaseErrorCode=DBINSERT_FAILURE
Code: 0
+++++++++++++++++++++++++++++++++++++++++

+++++++++++++++++++++++++++++++++++++++++

at com.mycompany.myproject.web.userprofile.facade.CountryFacade.createCountry(CountryFacade.java:69)
at com.mycompany.myproject.web.userprofile.action.UserAdminAction.updateEditUserForm(UserAdminAction.java:793)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at com.mycompany.myproject.web.userprofile.action.UserAdminAction.menuForward(UserAdminAction.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
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:1284)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1241)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
at com.mycompany.myproject.web.servlet.SessionAttributeFilter.doFilter(SessionAttributeFilter.java:59)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at com.mycompany.myproject.web.servlet.UserSessionFilter.doFilter(UserSessionFilter.java:203)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:671)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:89)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1924)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:89)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run

(ThreadPool.java:1471)


Please help me resolving this issue & below are the entries from my CocoBaseRepository.xml :


<CocoBaseRepository>
<CBObject MapName="Country" ClassName="Country" DefaultBlockSize="100" Version="4" AppVersion="3.0.2 " DateModified="2007-03-05 11:23:32.907">
<select>
<CBFields>
<CBField location="0" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="id" fieldvalue=":ID" dbfieldtype="int" fielddirection="0" dbtype="4" dbfieldsize="0" searchable="0" signed="0" keyposition="1" />
<CBField location="1" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_name" fieldvalue=":COUNTRY_NAME" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
<CBField location="2" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_code" fieldvalue=":COUNTRY_CODE" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
</CBFields>
<CBTables>
<CBTable catalogname="null" schemaname="dbo" tablename="country_list" tabletype="null" />
</CBTables>
<CBClauses/>
</select>
<insert>
<CBFields>
<CBField location="0" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="id" fieldvalue=":ID" dbfieldtype="int" fielddirection="0" dbtype="4" dbfieldsize="0" searchable="0" signed="0" keyposition="1" />
<CBField location="1" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_name" fieldvalue=":COUNTRY_NAME" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
<CBField location="2" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_code" fieldvalue=":COUNTRY_CODE" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
</CBFields>
<CBTables>
<CBTable catalogname="null" schemaname="dbo" tablename="country_list" tabletype="null" />
</CBTables>
<CBClauses/>
</insert>
<update>
<CBFields>
<CBField location="0" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="id" fieldvalue=":ID" dbfieldtype="int" fielddirection="0" dbtype="4" dbfieldsize="0" searchable="0" signed="0" keyposition="1" />
<CBField location="1" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_name" fieldvalue=":COUNTRY_NAME" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
<CBField location="2" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_code" fieldvalue=":COUNTRY_CODE" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
</CBFields>
<CBTables>
<CBTable catalogname="null" schemaname="dbo" tablename="country_list" tabletype="null" />
</CBTables>
<CBClauses/>
</update>
<delete>
<CBFields>
<CBField location="0" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="id" fieldvalue=":ID" dbfieldtype="int" fielddirection="0" dbtype="4" dbfieldsize="0" searchable="0" signed="0" keyposition="1" />
<CBField location="1" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_name" fieldvalue=":COUNTRY_NAME" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
<CBField location="2" catalogname="myproject50" schemaname="dbo" tablename="country_list" fieldname="country_code" fieldvalue=":COUNTRY_CODE" dbfieldtype="varchar" fielddirection="0" dbtype="12" dbfieldsize="0" searchable="0" signed="0" keyposition="-1" />
</CBFields>
<CBTables>
<CBTable catalogname="null" schemaname="dbo" tablename="country_list" tabletype="null" />
</CBTables>
<CBClauses/>
</delete>
<call>
<CBFieldReturns />
<CBProcedures />
<CBFieldParams />
</call>
</CBObject>
</CocoBaseRepository>

05-03-2007 03:10 AM
Click Here to See the Profile for vmongs    Find more posts by vmongs        Edit/Delete Message    Reply w/Quote    IP: Logged
admin
Administrator

Registered: Apr 2001
Posts: 19

Hi

This on the surface doesn't appear to be either a CocoBase or a facade issue - It seems like a runtime insert sql syntax issue - the jdbc driver is complaining - see the error:

[IBM][SQLServer JDBC Driver][SQLServer]Statement(s) could not be prepared.

Can you please add show.sql to their connection url cocoprop entries so we can see what is the insert sql being generated?

THOUGHT Support

05-09-2007 12:54 PM
Click Here to See the Profile for admin    Find more posts by admin        Edit/Delete Message    Reply w/Quote    IP: Logged
All times are PST (US)    Post New Thread     Post A Reply
Forum Jump:
< Previous Thread     Next Thread >

Forum Rules:
Who Can Read The Forum? Any registered user or guest.
Who Can Post New Topics? Any registered user.
Who Can Post Replies? Any registered user.
Changes: Messages can be edited by their author. Messages can be deleted by their author.
Posts: HTML code is OFF. Smilies are OFF. vB code is OFF. [IMG] code is OFF.

Admin Options:
Open / Close Thread
Move Thread
Delete Thread
Edit Thread

< Contact Us - THOUGHT Inc. >

Copyright © Jelsoft Enterprises Limited 2000.
Copyright 2001 All Rights Reserved, THOUGHT Inc.