Re: [Firebird-net-provider] fbConnection in Windows Service
> Different question: Is it better to use connection pooling for a windows > service, where I don´t know if the next connection is from the same user > or from a different one? I very much depends on the usage pattern. Better to measure than guess. But you can't make a wrong choice. It's just a fine-tuning. :) -- Mgr. Jiří Činčura Independent IT Specialist -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] fbConnection in Windows Service
Hello Jiri, I solved it by using FbConnectionStringBuilder only for the static configuration like hostname, charset etc. Username and password are added to the connection string and not written to the FbConnectionstringBuilder. Different question: Is it better to use connection pooling for a windows service, where I don´t know if the next connection is from the same user or from a different one? Niko -Ursprüngliche Nachricht- Von: Jiří Činčura [mailto:j...@cincura.net] Gesendet: Donnerstag, 21. Jänner 2016 20:42 An: For users and developers of the Firebird .NET providers <firebird-net-provider@lists.sourceforge.net> Betreff: Re: [Firebird-net-provider] fbConnection in Windows Service I'd guess you're probably modifying the class concurrently. Either use some locking or avoid concurrent access. -- Mgr. Jiří Činčura Independent IT Specialist -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] fbConnection in Windows Service
Hello all, one additional comment: The fbStringBuilder is a property of a public static class. Niko -Ursprüngliche Nachricht- Von: Nikolaus Kern [mailto:parzival1...@gmx.at] Gesendet: Donnerstag, 21. Jänner 2016 08:13 An: 'For users and developers of the Firebird .NET providers' <firebird-net-provider@lists.sourceforge.net> Betreff: Re: [Firebird-net-provider] fbConnection in Windows Service Hello Jiri, this is the staketrace: NOK KALENDER: Die Auflistung wurde geändert. Der Enumerationsvorgang kann möglicherweise nicht ausgeführt werden. bei System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) bei System.Collections.Generic.Dictionary`2.KeyCollection.Enumerator.MoveNext() bei FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder.GetKey(String keyword) bei FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder.SetValue[T](String keyword, T value) bei FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder.set_UserID(String value) bei Bauradar.WCFService.BauradarService.GetKalender(RequestKalender _input) in D:\vulcan4.net\Bauradar2Mobile\Bauradar.RestService\Bauradar.WCFService\BauradarService.prg:Zeile 46. Every time a method is called I set the username and password of the connection. When I hardcode username/password and set it only one time then the error does not occure. At this point in time I did not implement a more sophisticated authentication (e.g. using tokens after the first login). Any advice how to overcome this? Niko -Ursprüngliche Nachricht- Von: Jiří Činčura [mailto:j...@cincura.net] Gesendet: Dienstag, 19. Jänner 2016 21:09 An: For users and developers of the Firebird .NET providers <firebird-net-provider@lists.sourceforge.net> Betreff: Re: [Firebird-net-provider] fbConnection in Windows Service > 2. Each method creates a local fbConnection > > a. In this case I get following error: Enumeration was changed. > The > enumeration process can maybe not be performed. (Die Auflistung wurde > geändert. Der Enumerationsvorgang kann möglicherweise nicht ausgeführt > werden) What's the exception stack? > i. _fbCSB:Pooling := .F. Why false (I suppose that means false)? > I understood that fbConnection itself is not threadsafe – Correct. The FbConnection object should be used only in single thread (concurrently). But the pooling is thread safe and threading friendly. So having it on and keeping the connection opened as short as possible might help in MT scenarios. > but I don´t understand which object is alive accross the different calls of > the methods of the windows service. Not sure what you're talking about. -- Mgr. Jiří Činčura Independent IT Specialist -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] fbConnection in Windows Service
Hello Jiri, this is the staketrace: NOK KALENDER: Die Auflistung wurde geändert. Der Enumerationsvorgang kann möglicherweise nicht ausgeführt werden. bei System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) bei System.Collections.Generic.Dictionary`2.KeyCollection.Enumerator.MoveNext() bei FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder.GetKey(String keyword) bei FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder.SetValue[T](String keyword, T value) bei FirebirdSql.Data.FirebirdClient.FbConnectionStringBuilder.set_UserID(String value) bei Bauradar.WCFService.BauradarService.GetKalender(RequestKalender _input) in D:\vulcan4.net\Bauradar2Mobile\Bauradar.RestService\Bauradar.WCFService\BauradarService.prg:Zeile 46. Every time a method is called I set the username and password of the connection. When I hardcode username/password and set it only one time then the error does not occure. At this point in time I did not implement a more sophisticated authentication (e.g. using tokens after the first login). Any advice how to overcome this? Niko -Ursprüngliche Nachricht- Von: Jiří Činčura [mailto:j...@cincura.net] Gesendet: Dienstag, 19. Jänner 2016 21:09 An: For users and developers of the Firebird .NET providers <firebird-net-provider@lists.sourceforge.net> Betreff: Re: [Firebird-net-provider] fbConnection in Windows Service > 2. Each method creates a local fbConnection > > a. In this case I get following error: Enumeration was changed. > The > enumeration process can maybe not be performed. (Die Auflistung wurde > geändert. Der Enumerationsvorgang kann möglicherweise nicht ausgeführt > werden) What's the exception stack? > i. _fbCSB:Pooling := .F. Why false (I suppose that means false)? > I understood that fbConnection itself is not threadsafe – Correct. The FbConnection object should be used only in single thread (concurrently). But the pooling is thread safe and threading friendly. So having it on and keeping the connection opened as short as possible might help in MT scenarios. > but I don´t understand which object is alive accross the different calls of > the methods of the windows service. Not sure what you're talking about. -- Mgr. Jiří Činčura Independent IT Specialist -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
Re: [Firebird-net-provider] fbConnection in Windows Service
> 2. Each method creates a local fbConnection > > a. In this case I get following error: Enumeration was changed. > The > enumeration process can maybe not be performed. (Die Auflistung wurde > geändert. Der Enumerationsvorgang kann möglicherweise nicht ausgeführt > werden) What's the exception stack? > i. _fbCSB:Pooling := .F. Why false (I suppose that means false)? > I understood that fbConnection itself is not threadsafe – Correct. The FbConnection object should be used only in single thread (concurrently). But the pooling is thread safe and threading friendly. So having it on and keeping the connection opened as short as possible might help in MT scenarios. > but I don´t understand which object is alive accross the different calls of > the methods of the windows service. Not sure what you're talking about. -- Mgr. Jiří Činčura Independent IT Specialist -- Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311=/4140 ___ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider