Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple DB Connections

Status
Not open for further replies.

jbeetz1

Programmer
Nov 28, 2000
60
0
0
US
I have two SQL Anywhere V5.0 databases (DB1 & DB2) residing on a DB Server. I have multiple clients that need too access those two databases. I can start both databases on the server using two instances of dbsrv50.exe. I can get client1 to connect to DB1, but I cannot get client2 to connect to DB2. I am using dbclient.exe on both clients to connect to the database. The ODBC.ini registry entries are correct as far as which database file is associted with DB1 and DB2. I can get client2 to connect to DB1 so I know the connection works. Is it possible to accomplish what I want and if so what do I need to change to get it to work.

Thanks
Jerry
 
Create two transaction objects, connect each one to the appropriate database, and then use them for data retrieval as needed within your app with a 'USING' clause for embedded SQL or a 'SetTransObject' method call for datawindows.

Matt

"Nature forges everything on the anvil of time
 
Matt

I have tried this the problem I am having is how to I start the database on the server machine?

Thanks
Jerry
 
I guess you could either have the database start automatically upon boot up of the machine or create a script (.bat file) which you could run to start the database.

Matt

"Nature forges everything on the anvil of time
 
Can you try starting the two database instances Db1 & DB2 mapped to two different ports. I guess DB1 is mapped to port xxxx and when you try re-starting DB2 it goes against the same port xxxx only to find it being unavailable. You may also have to reinstall or reconfigure one database to be mapped to a different port.
- A0C61ZZ
 
This may be of no use because I haven't used the Sybase db (I assume this is ASA from the prog names) for quite some time now.

But anyway.

With some earlyish versions of the db server you could open more than one database in one instance of the server - has this changed?

Bill
 
I cannot see how you can start multiple databases with one instance of dbsrv50.

Jerry
 
I agree with Jerry. It could be multiple instances for one database, but definitely not the other way round.
- A0C61ZZ
 
Well you certainly can with some versions, remember this is natural with something like MS SQL Server.

In the manual for SQL Anywhere 5, there is a section (chap 28) about starting the database as an NT service and within this section it tells you how to start multiple databases.

"To start a network server service running two databases, with a cache size etc"
-c 20M
-n my_server
c:\sqlany50\db_1.db
c:\sqlany50\db_2.db

I am certain that I have done this in past.

Bill
 
Just wanted to let everyone know that I tried to start multiple databases with one instance of dbsrv50 and it worked. I was then able to connect to any of the databses that were running.

Thank you all for your help.
 
Well maybe we were on a different plane. I referred to instance in Oracle parlance, where you have one set of db files (Actual db) and multiple SGAs or memory areas (instances) of one db.

Whereas the instance you were talking about is the DB engine which actually starts the db. Here the engine is the same but the dbs (set of db files and db memory areas) are different.
- A0C61ZZ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top