[ 
http://issues.apache.org/jira/browse/IBATISNET-93?page=comments#action_12315806 
] 

Ron Grabowski commented on IBATISNET-93:
----------------------------------------

You marked this issue as affecting DataMapper 1.1. The latest version of the 
DataMapper is up to 1.2.1. There were changes made to the ByteArrayTypeHandler 
class on May 21, 2005 (svn revision 171207) that may have already resolved this 
issue. There aren't any loops in the current implementation:

 // determine the buffer size
 int bufferLength = (int) dataReader.GetBytes(columnIndex, 0, null, 0, 0);

 // initialize it
 byte[] byteArray = new byte[bufferLength];

 // fill it
 dataReader.GetBytes(columnIndex, 0, byteArray, 0, bufferLength);

 return byteArray;

> ArgumentOutofRange Exception in 
> IBatisNet.DataMapper.TypesHandler.ByteArrayTypeHandler.GetValueByIndex(Int, 
> IDataReader)
> ------------------------------------------------------------------------------------------------------------------------
>
>          Key: IBATISNET-93
>          URL: http://issues.apache.org/jira/browse/IBATISNET-93
>      Project: iBatis for .NET
>         Type: Bug
>   Components: DataMapper
>     Versions: DataMapper 1.1
>  Environment: WinXP, MSSQL 2000
>     Reporter: Andrew English

>
> If IBatisNet reads a byte stream (in my specific instance it was an image) 
> for which (numBytes % bufferSize == 0) is true from the database (MSSQL in 
> this case) MemoryStream.write throws an exception.  I believe this is because 
> the last # of bytes read was 0 since the previous read finished off the file 
> completely.  So after the loop there is the clean up write which writes 
> (int)bytesRead -1 bytes to the MemoryStream.  

-- 
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

Reply via email to