You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Elizabeth Baron <EB...@poindextersystems.com> on 2005/05/02 20:02:55 UTC
flushOnExecute iBatis in Spring
Hi,
I am a new user of iBatis, so thank you in advance for your patience.
Any help or advice you might be able to offer is appreciated.
My problem is as follows:
I have set up an SqlMap with a simple cache model and insert statement.
I am trying to force the cache to clear when the update named,
"updateNetwork", is executed. But when I try to deploy my application
in Tomcat (4.1.30), SqlMaps complains with this error and will not load
the resource:
Caused by: com.ibatis.common.exception.NestedRuntimeException: Error
parsing XPath '/sqlMapConfig/end()'. Cause:
com.ibatis.sqlmap.client.SqlMapException: There is no statement named
updateNetwork in this SqlMap.
Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no
statement named updateNetwork in this SqlMap.
When I remove the <flushOnExecute statement="updateNetwork"/>, the web
app starts without errors.
I feel like there is something very obvious that I am missing. Or maybe
it is some sort of Spring Framework/iBatis interaction that I don't
understand...
Thanks in advance,
Liz
The Network.xml mapping is:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="network">
<cacheModel id="NetworkCache"
type="LRU"
readOnly="false"
serialize="false">
<flushOnExecute statement="updateNetwork"/>
<flushInterval hours="24"/>
<property name="cache-size" value="1000"/>
</cacheModel>
<typeAlias alias="network" type="com.poindexter.Network"/>
<update id="updateNetwork"
parameterClass="network">
UPDATE NETWORK
SET NAME = #name#,
DISABLED = #disabled#
WHERE NETWORK_PK = #networkPK#
</update>
</sqlMap>
Re: flushOnExecute iBatis in Spring
Posted by Larry Meadors <la...@gmail.com>.
Are you using namespaces? Check your sql map config file. If namespaces are
enabled, se this instead:
<flushOnExecute statement="network.updateNetwork"/>
On 5/2/05, Elizabeth Baron <EB...@poindextersystems.com> wrote:
>
> Hi,
>
> I am a new user of iBatis, so thank you in advance for your patience.
> Any help or advice you might be able to offer is appreciated.
>
> My problem is as follows:
>
> I have set up an SqlMap with a simple cache model and insert statement.
> I am trying to force the cache to clear when the update named,
> "updateNetwork", is executed. But when I try to deploy my application
> in Tomcat (4.1.30), SqlMaps complains with this error and will not load
> the resource:
>
> Caused by: com.ibatis.common.exception.NestedRuntimeException: Error
> parsing XPath '/sqlMapConfig/end()'. Cause:
> com.ibatis.sqlmap.client.SqlMapException: There is no statement named
> updateNetwork in this SqlMap.
> Caused by: com.ibatis.sqlmap.client.SqlMapException: There is no
> statement named updateNetwork in this SqlMap.
>
> When I remove the <flushOnExecute statement="updateNetwork"/>, the web
> app starts without errors.
>
> I feel like there is something very obvious that I am missing. Or maybe
> it is some sort of Spring Framework/iBatis interaction that I don't
> understand...
>
> Thanks in advance,
> Liz
>
> The Network.xml mapping is:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
>
> <sqlMap namespace="network">
>
> <cacheModel id="NetworkCache"
> type="LRU"
> readOnly="false"
> serialize="false">
> <flushOnExecute statement="updateNetwork"/>
> <flushInterval hours="24"/>
> <property name="cache-size" value="1000"/>
> </cacheModel>
>
> <typeAlias alias="network" type="com.poindexter.Network"/>
>
> <update id="updateNetwork"
> parameterClass="network">
> UPDATE NETWORK
> SET NAME = #name#,
> DISABLED = #disabled#
> WHERE NETWORK_PK = #networkPK#
> </update>
>
> </sqlMap>
>