I think ibatis is doing the Right Thing in this case. Code like this
should be possible:

 Foo foo = new Foo(); 
 Foo fooClone = (Foo)((ICloneable)foo).Clone();

If you get some kind of issue tracker url, feel free to post it to the
list so we can follow the progress.

Gilles, Roberto: Should we add an attribute to the providers node to
disallow cloning even if the object implements ICloneable?

 allowCloning="false"

--- "Tan, Lee" <[EMAIL PROTECTED]> wrote:

> I figured it out, and it was with the cloning.  The problem is that
> iBatis clones then sets the connection string, if I set the
> connection
> string then clone everything is fine.  From what I see in the code,
> I'm
> stuck, so I'm off to contact Sybase support.  We'll see what they
> say...
> 
> Thanks for the help...
> 
> -----Original Message-----
> From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 29, 2005 6:16 PM
> To: [email protected]
> Subject: RE: Sybase ASE
> 
> 
> Maybe the connection string isn't being set correctly? What is the
> value
> of this:
> 
>  string connectionString = Mapper().DataSource.ConnectionString;
> 
> Is there a public download of the Sybase driver? I couldn't find a
> download link using Google.
> 
> The exception looks like its being because a property of the
> connection
> string could not be found.
> 
> --- "Tan, Lee" <[EMAIL PROTECTED]> wrote:
> 
> > I did both tests and they worked
> > 
> > I did have to change
> > IDbConnection clonedConn = ((ICloneable)conn).Clone();
> > to
> > IDbConnection clonedConn =
> (IDbConnection)((ICloneable)conn).Clone();
> > 
> > but the tests did work...
> > 
> > -----Original Message-----
> > From: Ron Grabowski [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, September 29, 2005 4:22 PM
> > To: [email protected]
> > Subject: Re: Sybase ASE
> > 
> > 
> > Have you verified that the connection string works using normal
> > ADO.Net:
> > 
> >  string connectionString =
> > @"Provider=Sybase.Ase;Data
> > Source=ASTOR;Port=5004;Database=QUAD0006;Min
> > Pool Size=1; Max Pool Size=2;User Id=xxxxxxx;Password=xxxxxxx";
> > 
> >  IDbConnection conn = new Sybase.Data.AseClient.AseConnection(
> >   connectionString);
> >   conn.Open();
> >   conn.Close();
> > 
> > If that works, try this:
> > 
> >  IDbConnection conn = new Sybase.Data.AseClient.AseConnection(
> >   connectionString);
> >  IDbConnection clonedConn = ((ICloneable)conn).Clone(); 
> > clonedConn.Open();  clonedConn.Close();
> > 
> > There have bugs with other providers (MySql Connector?) saying they
> 
> > implement ICloneable but throw an exception when the object is
> cloned.
> > 
> > --- "Tan, Lee" <[EMAIL PROTECTED]> wrote:
> > 
> > > I'm trying to setup my providers.config file to use the SybaseASE
> > dlls
> > > (Sybase.Data.AseClient.dll).  If someone could answer my problem 
> > > directly, I would appreciate that, otherwise if someone could
> point 
> > > me to some detailed docs about the providers.config file that
> would 
> > > be helpful too...
> > > 
> > > I took the iBatisTutorial sample
> > >
> >
>
http://prdownloads.sourceforge.net/ibatisnet/Tutorial-1.2.1.zip?download
> > > and got that running as is.  I'm now trying to switch the sample
> > app
> > > to use my Sybase Database.  This is what I've done...
> > > 
> > > In the providers.config file I added:
> > > 
> > >   <provider
> > >           name="SybaseAse1.1"
> > >           description="Sybase Adaptive Server Enterprise 12.5,
> > provider
> > > V1.1.411 in framework .NET V1.1"
> > >           default="true"
> > >           assemblyName="Sybase.Data.AseClient, Version=1.1.411.0,
> > > Culture=neutral, PublicKeyToken=26e0f1529304f4a7"
> > >           connectionClass="Sybase.Data.AseClient.AseConnection"
> > >           commandClass="Sybase.Data.AseClient.AseCommand"
> > >           parameterClass="Sybase.Data.AseClient.AseParameter"
> > >           parameterDbTypeClass="Sybase.Data.AseClient.AseDbType"
> > >           parameterDbTypeProperty="AseDbType"
> > >           dataAdapterClass="Sybase.Data.AseClient.AseDataAdapter"
> > >   
> > > commandBuilderClass="Sybase.Data.AseClient.AseCommandBuilder"
> > >           usePositionalParameter="false"
> > >           useParameterPrefixInSql="true"
> > >           useParameterPrefixInParameter = "true"
> > >           parameterPrefix="@"
> > >           />
> > > 
> > > And in the properties.config I put:
> > > 
> > > <settings>
> > >   <!--   User application and configured property settings go
> > > here.-->
> > >   <!--   Example: <add key="settingName" value="settingValue"/>
> > > -->
> > >   <add key="provider" value="SybaseAse1.1" />
> > >   <add 
> > >           key="connectionString" 
> > >           value="Provider=Sybase.Ase;Data
> > > Source=ASTOR;Port=5004;Database=QUAD0006;Min Pool Size=1; Max
> Pool 
> > > Size=2;User Id=xxxxxxx;Password=xxxxxxx" />
> > >   <add key="root" value="./" />           
> > > </settings>
> > > 
> > > When I run it, this is the error I get:
> > > Object reference not set to an instance of an object.
> > > 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.NullReferenceException: Object
> reference
> > not
> > > set to an instance of an object.
> > > 
> > > Source Error:
> > > 
> > > 
> > > Line 15:          public IList SelectAll ()
> > > Line 16:          {
> > > Line 17:                  return Mapper ().QueryForList ("Select",
> > > null);
> > > Line 18:          }
> > > Line 19:  
> > > 
> > > Source File:
> > c:\inetpub\wwwroot\ibatistutorial\model\personhelper.cs
> > > Line: 17
> > > 
> > > Stack Trace:
> > > 
> > > 
> > > [NullReferenceException: Object reference not set to an instance
> of
> > an
> > > object.]
> > >    Sybase.Data.AseClient.ConnectionProperties.Contains(String
> > > origName)
> > >   
> > Sybase.Data.AseClient.ConnectionProperties.GetUsedPropName(String
> > > origName)
> > >    Sybase.Data.AseClient.ConnectionProperties.GetValue(String
> > > origName)
> > >   
> Sybase.Data.AseClient.AseConnection.set_ConnectionString(String
> > > value)
> > >    Sybase.Data.AseClient.AseConnection..ctor(String
> > connectionString)
> > >    Sybase.Data.AseClient.AseConnection.Clone()
> > >    IBatisNet.Common.Provider.GetConnection()
> > >    IBatisNet.DataMapper.SqlMapSession.OpenConnection()
> > >    IBatisNet.DataMapper.SqlMapper.QueryForList(String
> > statementName,
> > > Object parameterObject)
> > >    iBatisTutorial.Model.PersonHelper.SelectAll() in 
> > > c:\inetpub\wwwroot\ibatistutorial\model\personhelper.cs:17
> > >    iBatisTutorial.Web.Forms.PersonPage.List_Load() in 
> > > c:\inetpub\wwwroot\ibatistutorial\webview\forms\person.aspx.cs:24
> > >    iBatisTutorial.Web.Forms.PersonPage.Page_Load(Object sender, 
> > > EventArgs e) in 
> > > c:\inetpub\wwwroot\ibatistutorial\webview\forms\person.aspx.cs:88
> > >    System.Web.UI.Control.OnLoad(EventArgs e)
> > >    System.Web.UI.Control.LoadRecursive()
> > >    System.Web.UI.Page.ProcessRequestMain()        
> > > 
> > > Thanks
> > > 
> > > 
> > > > Lee Tan
> 
=== message truncated ===

Reply via email to