In the 458 build, GetConnection() contained the following code: return (IDbConnection) ((ICloneable)_templateConnection).Clone();
The built-in providers (SqlClient, OleDb, etc.) implement the ICloneable interface. There a some 3rd party providers that do not. The exception you're seeing is most likely being caused by your provider not implementing ICloneable. This issue has been addressed and fixed: http://issues.apache.org/jira/browse/IBATISNET-46 - Ron --- Morten Schmidt <[EMAIL PROTECTED]> wrote: > This sums up how far I have come... > > OK, found out how to update the 5000 records... > > Now I have the issue of not being able to update to the latest > version > of the iBatisNet (458), because of the cast erro specified earlier. I > need iBatisNet to NOT chech whether an update was successfull, and > NOT > throw new ConcurrentException. > > I beleive the newer version are what I need. Furthermore I use > PostgreSQL, hence Npgsql (0.7beta5), and seem to find other issues > between these two? Am I right? > > Well, if someone could help me out with this, I'll sure be > greatefull!!! > > > This code: > > IBatisNet.DataMapper.Mapper.Instance(); > > Gives my a cast error: > > [snip] > Description: An unhandled exception occurred during the execution of > the > current web request. Please review the stack trace for more > information > about the error and where it originated in the code. > > Exception Details: System.InvalidCastException: Specified cast is not > valid. > [snap] > > And the trace on my ASP.NET page says: > > [InvalidCastException: Specified cast is not valid.] > IBatisNet.Common.Provider.GetCommand() +12 > IBatisNet.DataMapper.SqlMapSession.CreateCommand(CommandType > commandType) +33 > > IBatisNet.DataMapper.Configuration.Statements.PreparedStatementFactory.CreateParametersForStatementText() > +310 > > IBatisNet.DataMapper.Configuration.Statements.PreparedStatementFactory.Prepare() > +128 > > IBatisNet.DataMapper.Configuration.Sql.Static.StaticSql.BuildPreparedStatement(IDalSession > session, String sqlStatement) +105 > > IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ApplyInlineParemeterMap(SqlMapper > sqlMap, IStatement statement, String sqlStatement) +498 > > IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ProcessSqlStatement(XmlDocument > config, String sqlMapName, SqlMapper sqlMap, XmlNode commandTextNode, > IStatement statement) +170 > > IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureSqlMap(SqlMapper > sqlMap, XmlNode sqlMapNode) +2758 > IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize() > +1114 > IBatisNet.DataMapper.SqlMapper.ConfigureAndWatch(String fileName, > ConfigureHandler configureDelegate) +180 > IBatisNet.DataMapper.Mapper.Instance() +99 > > BudgetModel.Model.Helper.BudgetValueHelper.GetAllAccountIdsDistinct() > +116 > BudgetModel.Test.btnTest_Click(Object sender, EventArgs e) in > C:\Inetpub\wwwroot\Devolopment\smet\index.aspx.cs:41 > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 > > System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String > eventArgument) +57 > System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler > sourceControl, String eventArgument) +18 > System.Web.UI.Page.RaisePostBackEvent(NameValueCollection > postData) > +33 > System.Web.UI.Page.ProcessRequestMain() +1292 > > [snap] > > Using the old version og iBatisNet the code is OK (if I do not try to > update something that isn't there...) > But what is happening now? > > > Thx > Morten > > >