-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STAThread and OracleConnection.OpenAsync #427
Comments
I don't typically work with Windows Forms. Can you share a complete test case with the hanging behavior? The ODP.NET team and I can review it. It probably has something to do with using single-threaded apartments with ODP.NET async. |
The project is quite complex, since depending on the arguments in the program call, it can work as a console application or as a WPF (Windows Presentation Fundation) application. This project is almost entirely asynchronous, and has been working correctly with Oracle.ManagedDataAccess 21.x correctly, although I know that the methods are not asynchronous. However, when testing with version 23.x it hangs when establishing the connection. I have tried to make a simple project, but in this simple project the mentioned error does not occur. I just wanted to point out that when this error occurs, I have found this alternative solution. |
I have created a simple Windows Forms project where the above occurs. |
@FJGR65 Can you re-zip your Windows Forms app? I'm getting errors unzipping it. |
Sorry, I packed it with "7z" with some non-standard parameters. I'll upload it again and hope there won't be any problems unzipping it. |
@FJGR65 Thanks for the straightforward test case. I was able to reproduce the hang you experienced. I've filed Bug 37395788 for the ODP.NET team to review the test case and diagnose the problem. |
(ODP NET 23.6.1 with .NET Framework 4.8) OracleConnection.OpenAsync does not work when we have a WPF (STAThread) application. The application hangs when trying to open the connection asynchronously.
`
OracleConnection cn = new OracleConnection("DATA SOURCE=XXXXXX:1521/XE;PASSWORD=YYYYY;USER ID=ZZZZZ");
`
Viewing the end of trace file:
2024-12-12 12:22:57.943403 TID:5 (PRI) (EXT) (CID1) OracleConnection.OnConnectionOpen()
2024-12-12 12:22:57.949574 TID:5 (PRI) (ENT) (CID1) OracleConnectionImpl.InitializeDBSvcProperties()
2024-12-12 12:22:57.949574 TID:5 (PRI) (CID1) DB Svc AC Properties =>
2024-12-12 12:22:57.949574 TID:5 (PRI) (CID1) Application Continuity (AC/TAC) NOT Enabled on the connection
2024-12-12 12:22:57.960385 TID:5 (PRI) (SVC) (ENT) (CID1) OracleConnectionImpl.InitializeTAF()
2024-12-12 12:22:57.960385 TID:5 (PRI) (SVC) (CID1) TAF disabled through FAILOVER_TYPE=NONE configured on the connection string
2024-12-12 12:22:57.960385 TID:5 (PRI) (SVC) (EXT) (CID1) OracleConnectionImpl.InitializeTAF()
2024-12-12 12:22:57.961997 TID:5 (PRI) (SVC) (ENT) (CID1) OracleTransactionImpl.ctor()
2024-12-12 12:22:57.961997 TID:5 (PRI) (SVC) (EXT) (CID1) OracleTransactionImpl.ctor()
2024-12-12 12:22:57.961997 TID:5 (PRI) (SVC) (ENT) (CID1) OracleConnectionImpl.SetAutoCommit()
2024-12-12 12:22:57.961997 TID:5 (PRI) (SVC) (EXT) (CID1) OracleConnectionImpl.SetAutoCommit()
2024-12-12 12:22:57.966456 TID:5 (PRI) (SVC) (ENT) OracleGlobalizationImpl.GetLocaleSpecificNLSValues() Connecting with session time zone as :Europe/Paris
2024-12-12 12:22:57.972639 TID:5 (PRI) (ENT) (CID1) OracleConnection.OnStateChange()
2024-12-12 12:22:57.972639 TID:5 (PRI) (EXT) (CID1) OracleConnection.OnStateChange()
2024-12-12 12:22:57.972639 TID:5 (PRI) (CP) (CID1) OracleConnection.Open() (GET) (ENDSID=13:54549)
2024-12-12 12:22:57.973770 TID:5 (PUB) (EXT) (CID1) OracleConnection.OpenInternal() (conid=36328474) (state=Open) (sessid=13) (implid=49538252) (pooling=T) (CID1) (aff=n/a) (inst=xe) (affmatch=n/a) (pr.service=xe) (pr.pdb=) (pr.edition=) (sessid=13:54549) (T;F;F;xe;N) (pmid=47542785) (DISP) (service=xe;inst=xe;used=1;idle=0;tot=1)
2024-12-12 12:22:57.973770 TID:5 (PUB) (EXT) (CID1) OracleConnection.OpenAsyncHelper() //Hangs
The text was updated successfully, but these errors were encountered: