|
From: Stefan D S. <ste...@us...> - 2004-07-31 18:28:51
|
Thanks Dmitriy! Actually I had done that and it fixed the problem. Now,=
what I am noticing is that before using the batch all my statements woe=
re
done in one transaction, now using the executor, it appears that every
statement is now done in its own transaction. Why would this be the cas=
e?
Stefan,
declare FamiliesBO argument as final i.e.
public void deleteFamily(final FamiliesBO fbo) throws
DataAccessException {...}
Regards,
Dmitriy.
Stefan D Sookraj wrote:
> OK,
> I put 'public' in front of the line and that got rid of the error. i.=
e.
>
> public Object doInSqlMapClient(SqlMapExecutor executor) throws
> SQLException
>
> now, the only issue I am having is that I am having an error on the
> passed in business object (fbo).
>
> The error is: 'Cannot refer to a non-final variable fbo inside an
> inner class defined in a different method'
>
>
> public void deleteFamily(FamiliesBO fbo) throws DataAccessException {=
>
> getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
> public Object doInSqlMapClient(SqlMapExecutor executor)
> throws SQLException {
> executor.startBatch();
> executor.delete("AuthMaint.deleteCatExtendName",
> fbo.getMethodElement());
> Iterator itr =3D fbo.getRepItem().iterator();
> while (itr.hasNext()) {
> Map m =3D (HashMap) itr.next();
> executor.delete("AuthMaint.deleteDocMap", m);
> executor.delete("AuthMaint.deleteRepItem", m);
> }
> executor.delete("AuthMaint.deleteContentEdition",
> fbo.getMethodElement());
> executor.delete("AuthMaint.deleteMthElem",
> fbo.getMethodElement());
>
> executor.executeBatch();
> }
> });
>
> }
>
>
>
>
>
>
>
>
> Juergen,
> Thank you for the response. I am getting this error trying to
> implement the code snippit you provided.
>
> At this line I get the error:
> Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException
>
> Error:
> Cannot reduce the visibility of the inherited method from
> SqlMapClientCallback
>
>
> I am doing this in my DAO in my doUpdate method.
>
>
>
>
>
>
>
>
>
> Saturday, July 31, 2004 10:51 AM
> To: <spr...@li...>
> cc:
> From: j=FCrgen h=F6ller [werk3AT] <jue...@we...>
> Subject: Re: [Springframework-developer] How to do batch with Spring
> using Ibatis
>
>
>
> Implement a custom SqlMapClientCallback for this, a la:
>
> getSqlMapClientTemplate().execute(new SqlMapClientCallback() {
> Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException =
{
> executor.startBatch();
> executor.update(...);
> executor.update(...);
>
> executor.executeBatch();
> }
> });
>
> Generally, a SqlMapClientCallback allows you to call any methods on
> the passed-in com.ibatis.sqlmap.client.SqlMapExecutor object. The
> template will automatically convert SQLExceptions to
> DataAccessExceptions, just like it does for the convenience operation=
s
> defined on the template itself.
>
> Juergen
>
>
> ________________________________
>
> Von: spr...@li... im Auftrag=
> von Stefan D Sookraj
> Gesendet: Sa 31.07.2004 16:08
> An: spr...@li...
> Cc: spr...@li...; clinton.begin@ibatis.=
com
> Betreff: [Springframework-developer] How to do batch with Spring usin=
g
> Ibatis
>
>
>
>
>
>
>
> How do you invoke the underlying Ibatis API batch methods from Spring=
?
> I am
> using org.springframework.orm.ibatis.SqlMapClientTemplate, but the iB=
atis
> batch API is not exposed. If I use Ibatis API directly, I have to han=
dle
> the SQLExceptions. Is this the right way to be able to use the IBatis=
> batch
> API from Spring? Thank you.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by OSTG. Have you noticed the changes =
on
> Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now=
,
> one more big change to announce. We are now OSTG- Open Source Technol=
ogy
> Group. Come see the changes on the new OSTG site. www.ostg.com
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-develope=
r
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by OSTG. Have you noticed the changes =
on
> Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now=
,
> one more big change to announce. We are now OSTG- Open Source Technol=
ogy
> Group. Come see the changes on the new OSTG site. www.ostg.com
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-develope=
r
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on=
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technolog=
y
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer=
=
|