Title: Sharing DB Connection with firedac on Server Application Post by: mkurnia on November 17, 2015, 01:16:10 AM Hello Anyone,
I was new RTC SDK users to upgrade my previous application using DataSnap. but I find obstacles to implement the database connection. where before I use it the way there like on the blog Andreano lanuse(http://www.andreanolanusse.com/en/sharing-db-connection-between-multiples-datasnap-server-modules/). In RTC I have not gotten TDSSessionManager.GetThreadSession.Id like in DataSnap. so this time I made the connection at runtime just like the following: Code: procedure TdmServer.InsertMemberFuncExecute(Sender: TRtcConnection; there anything you can share the right way. Thank you. Title: Re: Sharing DB Connection with firedac on Server Application Post by: D.Tkalcec (RTC) on November 17, 2015, 08:00:19 AM Here is a FAQ topic about writing a Database Connection Pool (http://www.realthinclient.com/sdkarchive/indexfb7efb7e.html).
Best Regards, Danijel Tkalcec Title: Re: Sharing DB Connection with firedac on Server Application Post by: mkurnia on November 17, 2015, 09:15:05 AM how to use it properly,
whether the class at the runtime when datamodule create a server in the create? Code: procedure TdmServer.DataModuleCreate(Sender: TObject); then use Code: procedure TdmServer.InsertMemberFuncExecute(Sender: TRtcConnection; Title: Re: Sharing DB Connection with firedac on Server Application Post by: D.Tkalcec (RTC) on November 17, 2015, 09:21:00 AM Read the FAQ Article. It is all explained there. In a nutshell, you create the Pool at Application start, then use the GetDBConn method to get a connection from the pool and PutDBConn to place the connection back into the pool after use. Do NOT forget to place the connection back into the pool after use, or you will soon end up with a lot of open connections floating around, resulting in memory leaks and eventually crashing your Application Server!
Best Regards, Danijel Tkalcec |