Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Test 23.2.0 Core / Crash / Ora-50000

TobselAug 1 2023 — edited Aug 1 2023

Hello,

I created a small WPF-Application with the following Code (see below) trying asnyc / await.

The Test is to open 10 Connections Asynchronous / Parallel and messure the time of the whole ButtonClick and the time for the open of each connection.

When Pooling is off (Pooling = false), everything works as expected, but with active pooling (Pooling = true) the application hangs / crashes or throws ORA-50000: Connection request timed out.

Is there any reason for this?

        private async void OpenButton_Click(object sender, RoutedEventArgs e)
        {
            var connlst = new List<OracleConnection>();
            for (int i = 0; i < 10; i++)
            {
                connlst.Add(GetConnection());
            }

            var watch = Stopwatch.StartNew();

            var taskconnlst = connlst.Select(x => MyOpenDebug(x)).ToList();
            await Task.WhenAll(taskconnlst);

            watch.Stop();

            MyTextBox.Text = "Sum: " + watch.ElapsedMilliseconds + "\r\n";

            foreach (var item in taskconnlst)
            {
                MyTextBox.Text += "Opened: " + item.Result + "\r\n";;
            }
        }

        private async Task<string> MyOpenDebug(OracleConnection iConn)
        {
            var watch = Stopwatch.StartNew();
            await iConn.OpenAsync();
            watch.Stop();

            return watch.ElapsedMilliseconds.ToString();
        }

        private OracleConnection GetConnection()
        {
            OracleConnectionStringBuilder builder = new OracleConnectionStringBuilder();
            builder.UserID = "user";
            builder.Password = "password";
            builder.DataSource = "IP:Port/Sid";
            builder.Pooling = false;
            builder.MinPoolSize = 0;
            builder.MaxPoolSize = 10;
            OracleConnection conn = new OracleConnection(builder.ConnectionString);

            return conn;
        }
This post has been answered by Alex Keh-Oracle on Aug 28 2023
Jump to Answer
Comments
Post Details
Added on Aug 1 2023
24 comments
3,914 views