OracleConnectionPoolManager.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // OracleConnectionPoolManager.cs
  3. //
  4. // Part of the Mono class libraries at
  5. // mcs/class/System.Data.OracleClient/System.Data.OracleClient
  6. //
  7. // Assembly: System.Data.OracleClient.dll
  8. // Namespace: System.Data.OracleClient
  9. //
  10. // Authors:
  11. // Hubert FONGARNAND <[email protected]>
  12. //
  13. // (C) Copyright Hubert FONGARNAND, 2005
  14. //
  15. //
  16. // Licensed under the MIT/X11 License.
  17. //
  18. using System;
  19. using System.Collections;
  20. using System.Collections.Specialized;
  21. using System.ComponentModel;
  22. using System.Data;
  23. using System.Data.OracleClient.Oci;
  24. using System.Drawing.Design;
  25. using System.EnterpriseServices;
  26. using System.Text;
  27. using System.Threading;
  28. namespace System.Data.OracleClient
  29. {
  30. internal class OracleConnectionPoolManager
  31. {
  32. Hashtable pools = new Hashtable();
  33. public OracleConnectionPoolManager ()
  34. {
  35. }
  36. public OracleConnectionPool GetConnectionPool (OracleConnectionInfo info, int minPoolSize, int maxPoolSize)
  37. {
  38. lock (pools) {
  39. OracleConnectionPool pool = (OracleConnectionPool) pools [info.ConnectionString];
  40. if (pool == null) {
  41. pool = new OracleConnectionPool (this, info, minPoolSize, maxPoolSize);
  42. pools [info.ConnectionString] = pool;
  43. }
  44. return pool;
  45. }
  46. }
  47. public virtual OciGlue CreateConnection (OracleConnectionInfo info)
  48. {
  49. OciGlue oci;
  50. oci = new OciGlue ();
  51. oci.CreateConnection (info);
  52. return oci;
  53. }
  54. }
  55. }