Re: Inconsistent results from INFORMATION_SCHEMA.system_sessions
Fred Toussi <[email protected]>
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <[email protected]> |
Your program must be connecting with a user that has no admin privileges. Therefore the session sees only itself, not any other sessions. Fred On Mon, Jan 27, 2014, at 18:36, Jeff Cadman wrote: Hi, Executing the same query in the databasemanager (using DatabaseManagerSwing) displays the correct result - running 4 simultaneous instances of the program returns 4, as expected. The issue is that each java program returns 'connections: 1' irrespective of how many java programs are running. I am running a server on port 9001 and connecting to it using jdbc on the same box. Jeff __________________________________________________________________ From: [email protected] To: [email protected] Date: Mon, 27 Jan 2014 18:07:59 +0000 Subject: Re: [Hsqldb-user] Inconsistent results from INFORMATION_SCHEMA.system_sessions What happens when you execute the same query in DatabaseManager? Are you running a Server and connecting to it from several instances of YOUR program? Fred On Mon, Jan 27, 2014, at 16:10, Jeff Cadman wrote: Hi, I have a java program running: String sql = "select count(*) from INFORMATION_SCHEMA.system_sessions"; ResultSet rs = st.executeQuery(sql); while(rs.next()) { String n = rs.getString(1); System.out.println("connections: " + n); TimeUnit.SECONDS.sleep(3); } No matter how many instances of this program are running, it always prints out: connections: 1 Curiously, the execution of: select * from INFORMATION_SCHEMA.system_sessions; in the manager GUI (DatabaseManagerSwing) displays the correct result. Either a) What am I missing, or b) How do I programmatically detect the number of sessions connected to the DB? tnx... ----------------------------------------------------------------------- ------- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. [1]http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ost g.clktrk _______________________________________________ Hsqldb-user mailing list [2][email protected] [3]https://lists.sourceforge.net/lists/listinfo/hsqldb-user ----------------------------------------------------------------------- ------- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.c lktrk _______________________________________________ Hsqldb-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hsqldb-user ----------------------------------------------------------------------- ------- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. [4]http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ost g.clktrk _______________________________________________ Hsqldb-user mailing list [5][email protected] [6]https://lists.sourceforge.net/lists/listinfo/hsqldb-user References 1. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk 2. mailto:[email protected] 3. https://lists.sourceforge.net/lists/listinfo/hsqldb-user 4. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk 5. mailto:[email protected] 6. https://lists.sourceforge.net/lists/listinfo/hsqldb-user ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Hsqldb-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/hsqldb-user