Re: Inconsistent results from INFORMATION_SCHEMA.system_sessions

Jeff Cadman <[email protected]>
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <[email protected]>
Hi,
Executing the same query in the databasemanager (using DatabaseManagerSwing)displays the correct result - running 4 simultaneous instances of the programreturns 4, as expected.
The issue is that each java program returns 'connections: 1' irrespectiveof how many java programs are running.
I am running a server on port 9001 and connecting to it using jdbc on the same box.
JeffFrom: [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.
			
				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
		
	


	 

------------------------------------------------------------------------------
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

------------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.