4 // Part of managed C#/.NET library System.Data.OracleClient.dll
6 // Part of the Mono class libraries at
7 // mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci
9 // Assembly: System.Data.OracleClient.dll
10 // Namespace: System.Data.OracleClient.Oci
13 // Tim Coleman <tim@timcoleman.com>
15 // Copyright (C) Tim Coleman, 2003
19 using System.Runtime.InteropServices;
21 namespace System.Data.OracleClient.Oci {
22 internal sealed class OciServerHandle : OciHandle, IDisposable
26 bool disposed = false;
27 bool attached = false;
28 OciErrorHandle errorHandle;
34 public OciServerHandle (OciHandle parent, IntPtr newHandle)
35 : base (OciHandleType.Server, parent, newHandle)
39 #endregion // Constructors
43 public bool Attach (string tnsname, OciErrorHandle error)
47 int status = OciCalls.OCIServerAttach (this, error, tnsname, tnsname.Length, 0);
50 OciErrorInfo info = errorHandle.HandleError ();
51 throw new OracleException (info.ErrorCode, info.ErrorMessage);
58 public void Detach (OciErrorHandle error)
63 int status = OciCalls.OCIServerDetach (this, error, 0);
66 OciErrorInfo info = errorHandle.HandleError ();
67 throw new OracleException (info.ErrorCode, info.ErrorMessage);
73 protected override void Dispose (bool disposing)
77 //Detach (errorHandle);
80 base.Dispose (disposing);