IDao implementation with ref parameter causes System.ExecutionEngineException.
-------------------------------------------------------------------------------
Key: IBATISNET-144
URL: http://issues.apache.org/jira/browse/IBATISNET-144
Project: iBatis for .NET
Type: Bug
Components: DataAccess
Versions: DataAccess 1.7
Environment: Microsoft Windows XP Professional Version 2002 SP2
Microsoft Development Environment 2003 Version 7.1.3091
Microsoft .NET Framework 1.1 Version 1.1.4322 SP1
Microsoft Visual C# .NET 69519-005-8935845-18415
DataMapper 1.3(356824)
DataAccess 1.7(356824)
Reporter: Noriyuki
Implementing IDao and defining Dao method with "ref" parameter
and loading through DaoManager causes
"An unhandled exception of type 'System.ExecutionEngineException' occurred in
mscorlib.dll".
This problem only happens if I load my Dao through
DaoManager(of DataAccess Framework) with "ref" parameter and not happens
if I load my Dao directly through SqlMapper(of DataMapper Framework)
with "ref" parameter.
This might be the DynamicProxy issue.
The following snippet describes the differences between the above.
/*************************************************************************************/
private DaoManager daoManager;
private IDailyDao dailyDao = null;
internal DailyService()
{
//DataAccessConfigurator configures and loads DaoManager
daoManager = DataAccessConfigurator.GetDaoManager();
}
public bool LoadThroughDaoManager(ref object dailyDB, string
sOfficeCode)
{
//This load DailyDao instance through dao.config
dailyDao = daoManager[typeof(IDailyDao)] as IDailyDao;
try
{
//Begin trans
using (IDalSession session =
this.daoManager.OpenConnection())
{
dailyDao.SelectDaily(sOfficeCode, ref
dailyDB);
}
return true;
}
catch (Exception ex)
{
throw new
RdbAccessException(string.Format(@"Failed to load Daily throught DailyService.
OfficeCode={0} DailyNo={1}",sOfficeCode,((DailyDB)dailyDB).sNo), ex);
}
}
public bool LoadThroughSqlMapper(ref object dailyDB, string
sOfficeCode)
{
IBatisNet.DataMapper.SqlMapper mapper =
IBatisNet.DataMapper.Mapper.Instance();
//Directly instantiate DailyDao
dailyDao = new DailyDao();
((DailyDao)dailyDao).SetContext(mapper);
try
{
//Begin trans
using (IDalSession session =
mapper.OpenConnection())
{
dailyDao.SelectDaily(sOfficeCode, ref
dailyDB);
}
return true;
}
catch (Exception ex)
{
throw new
RdbAccessException(string.Format(@"Failed to load Daily throught DailyService.
OfficeCode={0} DailyNo={1}",sOfficeCode,((DailyDB)dailyDB).sNo), ex);
}
}
/*************************************************************************************/
The same exception occurs in the environment of the recent SVN version.
Any response is appreciated.
[Note]
Using NAnt with iBATIS.build file of the recent SVN causes compile error
unless you remove the following files.
IBatisNet.Common.Logging.IDataReaderProxy.cs
IBatisNet.Common.Logging.IDbCommandProxy.cs
IBatisNet.Common.Logging.IDbConnectionProxy.cs
--
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