You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Andrew Lion (JIRA)" <ib...@incubator.apache.org> on 2007/10/29 04:10:50 UTC

[jira] Created: (IBATISNET-247) Null in Oracle output parameter is not being converted to NullValue configured for a property in the parameterMap

Null in Oracle output parameter is not being converted to NullValue configured for a property in the parameterMap
-----------------------------------------------------------------------------------------------------------------

                 Key: IBATISNET-247
                 URL: https://issues.apache.org/jira/browse/IBATISNET-247
             Project: iBatis for .NET
          Issue Type: Bug
          Components: DataMapper
    Affects Versions: DataMapper 1.6.1
         Environment: WinXp, .Net 1.1, VS2003, Oracle ODP 9.2
            Reporter: Andrew Lion
            Priority: Minor


In the following configuration, I expected a  PlmDocId property to be set to NullValue=-9999 but instead got the exception:
"... 
IBatisNet.Common.Exceptions.IBatisNetException: Error executing query 'FlxProcessLogMap.Save' for insert.  Cause: Object cannot be cast from DBNull to other types. ---> System.InvalidCastException: Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToInt64(IFormatProvider provider)
   at System.Convert.ToInt64(Object value)
   at IBatisNet.DataMapper.TypeHandlers.Int64TypeHandler.GetDataBaseValue(Object outputValue, Type parameterType)
   at IBatisNet.DataMapper.MappedStatements.MappedStatement.RetrieveOutputParameters(RequestScope request, ISqlMapSession session, IDbCommand command, Object result)
   at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteInsert(ISqlMapSession session, Object parameterObject)
..."


Configuration:

<parameterMap id="SaveParameters" class="Hashtable">
             <parameter property="log.PlmDocId" direction="InputOutput" column="P_PLM_DOC_ID" dbType="Int64" type="long" nullValue="-9999"/>
     ...
</parameterMap>	



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.