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 Неверов Дмитрий <ne...@nkmk.ru> on 2005/09/01 02:43:59 UTC

maxRequests, help

Hi, 

I have SqlMapConfig.xml:

<?xml version='1.0' encoding='windows-1251' ?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
  
  <settings cacheModelsEnabled="true"
    enhancementEnabled="true"
    lazyLoadingEnabled="true" maxRequests="32"
    maxSessions="8" maxTransactions="2"
    useStatementNamespaces="false" />
  
  <transactionManager type="JDBC">
    <dataSource type="JNDI">
      <property name="DataSource" value="jdbc/himDS"/>
    </dataSource>
  </transactionManager>

  <sqlMap resource="nkmk/ibatis/sqlmap/maps/test.xml"/>
  <sqlMap resource="nkmk/ibatis/sqlmap/maps/Element.xml"/>
  <sqlMap resource="nkmk/ibatis/sqlmap/maps/Gost.xml"/>

</sqlMapConfig>

insert:

  <insert id="insertGost" parameterClass="Gost">
    insert into sp_gost (name_gost) values (#gostName#)
  </insert>

and sprGosts.jsp, that used to insert new Gost:

    String gostName = WebUtils.getStringParameter(request, "gost_name", "");
    GostDAO gostDAO = new GostDAO(); 
    Gost gost = new Gost();
    gost.setGostName(gostName);
    int a = gostDAO.insertGost(gost); 
    response.sendRedirect("sprGosts.jsp");


After 2 inserts browser try to open page (redirect after insert), but
never open it.

Early I have such problem because of wrong values of maxRequests,
maxSessions, maxTransactions parameters. But now I think they are
right.

There is my mistake?

-- 
Thanks.
mailto:neverov_dg@nkmk.ru





Re: maxRequests, help

Posted by Clinton Begin <cl...@gmail.com>.
Those settings are really low. Are you sure you don't want/need more?

What is wrong with the defaults?

Cheers,
Clinton


On 8/31/05, Неверов Дмитрий <ne...@nkmk.ru> wrote:
> 
> Hi,
> 
> I have SqlMapConfig.xml:
> 
> <?xml version='1.0' encoding='windows-1251' ?>
> <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" 
> "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
> <sqlMapConfig>
> 
> <settings cacheModelsEnabled="true"
> enhancementEnabled="true"
> lazyLoadingEnabled="true" maxRequests="32"
> maxSessions="8" maxTransactions="2"
> useStatementNamespaces="false" />
> 
> <transactionManager type="JDBC">
> <dataSource type="JNDI">
> <property name="DataSource" value="jdbc/himDS"/>
> </dataSource>
> </transactionManager>
> 
> <sqlMap resource="nkmk/ibatis/sqlmap/maps/test.xml"/>
> <sqlMap resource="nkmk/ibatis/sqlmap/maps/Element.xml"/>
> <sqlMap resource="nkmk/ibatis/sqlmap/maps/Gost.xml"/>
> 
> </sqlMapConfig>
> 
> insert:
> 
> <insert id="insertGost" parameterClass="Gost">
> insert into sp_gost (name_gost) values (#gostName#)
> </insert>
> 
> and sprGosts.jsp, that used to insert new Gost:
> 
> String gostName = WebUtils.getStringParameter(request, "gost_name", "");
> GostDAO gostDAO = new GostDAO();
> Gost gost = new Gost();
> gost.setGostName(gostName);
> int a = gostDAO.insertGost(gost);
> response.sendRedirect("sprGosts.jsp");
> 
> 
> After 2 inserts browser try to open page (redirect after insert), but
> never open it.
> 
> Early I have such problem because of wrong values of maxRequests,
> maxSessions, maxTransactions parameters. But now I think they are
> right.
> 
> There is my mistake?
> 
> --
> Thanks.
> mailto:neverov_dg@nkmk.ru
> 
> 
> 
> 
>

Re: maxRequests, help

Posted by Неверов Дмитрий <ne...@nkmk.ru>.
I just now understand that's wrong. I have BaseDAO
and other DAO extends it, and in BaseDAO I just do commitTransaction()
and  don't endTransaction(). Sorry for disturb.

---------------------------------
You wrote 1 сентября 2005 г., 8:43:59:

> Hi, 

> I have SqlMapConfig.xml:

> <?xml version='1.0' encoding='windows-1251' ?>
> <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config
> 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
> <sqlMapConfig>
  
>   <settings cacheModelsEnabled="true"
>     enhancementEnabled="true"
>     lazyLoadingEnabled="true" maxRequests="32"
>     maxSessions="8" maxTransactions="2"
>     useStatementNamespaces="false" />
  
>   <transactionManager type="JDBC">
>     <dataSource type="JNDI">
>       <property name="DataSource" value="jdbc/himDS"/>
>     </dataSource>
>   </transactionManager>

>   <sqlMap resource="nkmk/ibatis/sqlmap/maps/test.xml"/>
>   <sqlMap resource="nkmk/ibatis/sqlmap/maps/Element.xml"/>
>   <sqlMap resource="nkmk/ibatis/sqlmap/maps/Gost.xml"/>

> </sqlMapConfig>

> insert:

>   <insert id="insertGost" parameterClass="Gost">
>     insert into sp_gost (name_gost) values (#gostName#)
>   </insert>

> and sprGosts.jsp, that used to insert new Gost:

>     String gostName = WebUtils.getStringParameter(request, "gost_name", "");
>     GostDAO gostDAO = new GostDAO(); 
>     Gost gost = new Gost();
>     gost.setGostName(gostName);
>     int a = gostDAO.insertGost(gost); 
>     response.sendRedirect("sprGosts.jsp");


> After 2 inserts browser try to open page (redirect after insert), but
> never open it.

> Early I have such problem because of wrong values of maxRequests,
> maxSessions, maxTransactions parameters. But now I think they are
> right.

> There is my mistake?


---------------------------------
-- 
Неверов                          mailto:neverov_dg@nkmk.ru