From: Nikolaus K. <par...@gm...> - 2016-01-19 18:30:26
|
Hello, I am using Firebird .net Provider (at the moment 4.9) in a Windows Service that sends JSON data to a mobile app. The only problem there is the handling of the fbConnection. 1. There is a static class to provide the fbConnectionStringBuilder 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) 3. That means also that there is new login in every method 4. The fbConnectionStringBuilder looks like this: a. _fbCSB := FbConnectionStringBuilder{} b. _fbCSB:Database := _database c. _fbCSB:DataSource := _server d. _fbCSB:Charset := "ISO8859_1" e. _fbCSB:Role := "BAURADAR_ADMIN" f. _fbCSB:Port := 3050 g. _fbCSB:Dialect := 3 h. _fbCSB:ConnectionLifeTime := 15 i. _fbCSB:Pooling := .F. j. _fbCSB:PacketSize := 8192 k. _fbCSB:ServerType := 0 The question is: What is the correct way to use fbConnection in a windows service? There seems to be an object still alive when the next method (with an own fbConnection object) is called. I understood that fbConnection itself is not threadsafe but I don´t understand which object is alive accross the different calls of the methods of the windows service. http://firebird.1100200.n4.nabble.com/connection-pooling-in-a-multithreading -environment-td1469737.html Thanks Niko |