Subject | multithreaded app having trouble connecting |
---|---|
Author | Nik |
Post date | 2005-02-20T10:18:03Z |
hi,
I have an application that creates 50 threads, and then every 5
seconds all the threads attach and insert some data into a firebird
Super Server 1.5 database (this is currently using the firebird C++
api rather than things like ibpp etc).
The attach code is straight out of the documentation;
isc_db_handle newdb = NULL; /* database handle */
isc_tr_handle trans = NULL; /* transaction handle */
ISC_STATUS_ARRAY status; /* status vector */
char* dataDB = "127.0.0.1:/opt/firebird/myDatabase.fdb";
if (isc_attach_database(status, 0, dataDB, &newdb, 0, NULL)) {
isc_print_status(status);
return;
}
Occasionally a thread will throw up;
Unable to complete network request to host "127.0.0.1".
-Failed to establish a connection.
-Connection refused
increasing the rate that the threads enter the data greatly
increases the number of these errors.
I initially had the database name as "/opt/firebird/myDatabase.fdb"
and the error had;
Unable to complete network request to host "localhost".
I made the change in case it was some problem accessing the host
file...
Nothing else is accessing the database.
What am I likely to be doing wrong to get this error - I was hoping
to run 250 or so threads in all. Even one message not reaching the
database wouldn't be acceptable to my application.
nik
I have an application that creates 50 threads, and then every 5
seconds all the threads attach and insert some data into a firebird
Super Server 1.5 database (this is currently using the firebird C++
api rather than things like ibpp etc).
The attach code is straight out of the documentation;
isc_db_handle newdb = NULL; /* database handle */
isc_tr_handle trans = NULL; /* transaction handle */
ISC_STATUS_ARRAY status; /* status vector */
char* dataDB = "127.0.0.1:/opt/firebird/myDatabase.fdb";
if (isc_attach_database(status, 0, dataDB, &newdb, 0, NULL)) {
isc_print_status(status);
return;
}
Occasionally a thread will throw up;
Unable to complete network request to host "127.0.0.1".
-Failed to establish a connection.
-Connection refused
increasing the rate that the threads enter the data greatly
increases the number of these errors.
I initially had the database name as "/opt/firebird/myDatabase.fdb"
and the error had;
Unable to complete network request to host "localhost".
I made the change in case it was some problem accessing the host
file...
Nothing else is accessing the database.
What am I likely to be doing wrong to get this error - I was hoping
to run 250 or so threads in all. Even one message not reaching the
database wouldn't be acceptable to my application.
nik