You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org> on 2005/07/08 06:24:09 UTC

[jira] Created: (IBATISNET-87) MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings

MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings
--------------------------------------------------------------------------------------------------------------------------------

         Key: IBATISNET-87
         URL: http://issues.apache.org/jira/browse/IBATISNET-87
     Project: iBatis for .NET
        Type: Bug
  Components: DataMapper  
    Reporter: Ron Grabowski
    Priority: Critical


The first two lines of the method are:

 RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
 using ( IDbCommand command = _preparedCommand.Create( request, session, this.Statement, parameterObject ))

The first two lines should be along the lines of:

 RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
 if (_statement.CacheModel == null) 

All of the overloaded ExecuteQueryForList methods call through to RunQueryForList .
All of the overloaded ExecuteQueryForObject methods call through to RunQueryForObject.
All of the overloaded ExecuteQueryForMap methods call through to RunQueryForMap.

I looked in ViewCVS and it looks like the method has been incorrect since May 2004.

There aren't any unit tests for this style of QueryForList:

 UserCollection userCollection = new UserCollection();
 sqlMapper.QueryForList("User.GetMany", null, userCollection);
 return userCollection;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Created: (IBATISNET-87) MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings

Posted by Ron Grabowski <ro...@yahoo.com>.
That's not entiretly true. There aren't any in CacheTest.cs.

--- "Ron Grabowski (JIRA)" <ib...@incubator.apache.org> wrote:
> 
> There aren't any unit tests for this style of QueryForList:
> 
>  UserCollection userCollection = new UserCollection();
>  sqlMapper.QueryForList("User.GetMany", null, userCollection);
>  return userCollection;

[jira] Commented: (IBATISNET-87) MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings

Posted by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATISNET-87?page=comments#action_12315447 ] 

Ron Grabowski commented on IBATISNET-87:
----------------------------------------

If the public method changed to this:

 ExecuteQueryForList(string statementId, object parameterObject, Type listResultObject )

It would be the same as if you had used a listClass attribute on the <select>. Caching could be enabled.

One of the benefits of passing in an existing IList is that you don't have to pay the penalty of calling Activator.CreateInstance at runtime.

> MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings
> --------------------------------------------------------------------------------------------------------------------------------
>
>          Key: IBATISNET-87
>          URL: http://issues.apache.org/jira/browse/IBATISNET-87
>      Project: iBatis for .NET
>         Type: Bug
>   Components: DataMapper
>     Reporter: Ron Grabowski
>     Priority: Critical

>
> The first two lines of the method are:
>  RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
>  using ( IDbCommand command = _preparedCommand.Create( request, session, this.Statement, parameterObject ))
> The first two lines should be along the lines of:
>  RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
>  if (_statement.CacheModel == null) 
> All of the overloaded ExecuteQueryForList methods call through to RunQueryForList .
> All of the overloaded ExecuteQueryForObject methods call through to RunQueryForObject.
> All of the overloaded ExecuteQueryForMap methods call through to RunQueryForMap.
> I looked in ViewCVS and it looks like the method has been incorrect since May 2004.
> There aren't any unit tests for this style of QueryForList:
>  UserCollection userCollection = new UserCollection();
>  sqlMapper.QueryForList("User.GetMany", null, userCollection);
>  return userCollection;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATISNET-87) MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings

Posted by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATISNET-87?page=comments#action_12320700 ] 

Ron Grabowski commented on IBATISNET-87:
----------------------------------------

Apparently this overload isn't supported in the Java version:

 UserCollection userCollection = new UserCollection();
 sqlMapper.QueryForList("User.GetMany", null, userCollection);
 return userCollection;

Even with the recent rounds of fixes, I still can't think of a way to efficiently populate the passed in object without getting an IList out of the cache and re-iterating through it to populate the passed in object.

My vote is for depreciating the method and eventually removing it.

> MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings
> --------------------------------------------------------------------------------------------------------------------------------
>
>          Key: IBATISNET-87
>          URL: http://issues.apache.org/jira/browse/IBATISNET-87
>      Project: iBatis for .NET
>         Type: Bug
>   Components: DataMapper
>     Reporter: Ron Grabowski
>     Priority: Critical

>
> The first two lines of the method are:
>  RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
>  using ( IDbCommand command = _preparedCommand.Create( request, session, this.Statement, parameterObject ))
> The first two lines should be along the lines of:
>  RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
>  if (_statement.CacheModel == null) 
> All of the overloaded ExecuteQueryForList methods call through to RunQueryForList .
> All of the overloaded ExecuteQueryForObject methods call through to RunQueryForObject.
> All of the overloaded ExecuteQueryForMap methods call through to RunQueryForMap.
> I looked in ViewCVS and it looks like the method has been incorrect since May 2004.
> There aren't any unit tests for this style of QueryForList:
>  UserCollection userCollection = new UserCollection();
>  sqlMapper.QueryForList("User.GetMany", null, userCollection);
>  return userCollection;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATISNET-87) MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings

Posted by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/IBATISNET-87?page=comments#action_12315378 ] 

Ron Grabowski commented on IBATISNET-87:
----------------------------------------

ExecuteQueryForRowDelegate also ignores the cache.

> MappedStatement.ExecuteQueryForList(IDalSession session, object parameterObject, IList resultObject ) ignores all cache settings
> --------------------------------------------------------------------------------------------------------------------------------
>
>          Key: IBATISNET-87
>          URL: http://issues.apache.org/jira/browse/IBATISNET-87
>      Project: iBatis for .NET
>         Type: Bug
>   Components: DataMapper
>     Reporter: Ron Grabowski
>     Priority: Critical

>
> The first two lines of the method are:
>  RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
>  using ( IDbCommand command = _preparedCommand.Create( request, session, this.Statement, parameterObject ))
> The first two lines should be along the lines of:
>  RequestScope request = _statement.Sql.GetRequestScope(parameterObject, session);
>  if (_statement.CacheModel == null) 
> All of the overloaded ExecuteQueryForList methods call through to RunQueryForList .
> All of the overloaded ExecuteQueryForObject methods call through to RunQueryForObject.
> All of the overloaded ExecuteQueryForMap methods call through to RunQueryForMap.
> I looked in ViewCVS and it looks like the method has been incorrect since May 2004.
> There aren't any unit tests for this style of QueryForList:
>  UserCollection userCollection = new UserCollection();
>  sqlMapper.QueryForList("User.GetMany", null, userCollection);
>  return userCollection;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira