From: thomas at tada.se (Thomas Hallgren) Date: Fri, 20 Dec 2013 07:13:50 +0100 Subject: [Pljava-dev] doubtful PL/Java's activity In-Reply-To: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DA16@G01JPEXMBYT02> References: <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86280C@G01JPEXMBYT02> <52A970BB.8030904@tada.se> <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86B431@G01JPEXMBYT02> <52AAA743.40309@tada.se> <2AB2177C63D24C43AC3BDE9A3A8F71FC1C86DA16@G01JPEXMBYT02> Message-ID: <52B3E01E.5000008@tada.se> On 2013-12-20 05:51, Taniguchi, Yasunori wrote: > Thank you, Mr. Thomas, > > Sorry for my late response. > >> The backend is single threaded (each connection runs in it's own process and it's own JVM) so there will never be two functions executing simultanously. > Yes, I understand. > But, multi thread applications (unless using concurrent JDBC call) can run in JavaVM even if postgres backend is single threaded, I think. Each connection that a multi threaded client application opens is attached to one single threaded backend process and hence, each connection will run in its own JVM. These connections cannot access the same global data since they live in different process spaces. - thomas