Board index » delphi » middleware server

middleware server


2007-10-10 06:28:51 AM
delphi44
We are developing our own middleware server using TCP/IP.
The connections are persistent between clients and server.
Each Client creates its own thread on the server.
We are using Firebird for data store and IBExpress for connection.
¿Do we need a IBConnection for each Client (inside each thread)?, ¿A single
IBConnection could be shared (between threads)?
¿What's the best approach for this scenario?
Thanks in advance
Daniel
 
 

Re:middleware server

Quote
¿What's the best approach for this scenario?
Each thread **must** use own IBConnection.
Regards,
Dmitry
--
Dmitry Arefiev - www.da-soft.com
AnyDAC - Oracle, MySQL, MS SQL, MSAccess, IBM DB2, Sybase
ASA, Interbase/Firebird, DbExpress, ODBC data access engine
ThinDAC - multitier data access engine
 

Re:middleware server

Dmitry Arefiev [da-soft.com] writes:
Quote
>¿What's the best approach for this scenario?

Each thread must use own IBConnection.
Probably true since he's using Firebird. But as a general statement
it's not right. In some circumstances, with InterBase 6.5+, threads can
share a single TIBDatabase component.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
How to ask questions the smart way:
www.catb.org/~esr/faqs/smart-questions.html
 

Re:middleware server

Quote
In some circumstances, with InterBase 6.5+, threads can
share a single TIBDatabase component.
I am expecting, that single server session will serialize requests.
Am I right ?
Regards,
Dmitry
--
Dmitry Arefiev - www.da-soft.com
AnyDAC - Oracle, MySQL, MS SQL, MSAccess, IBM DB2, Sybase
ASA, Interbase/Firebird, DbExpress, ODBC data access engine
ThinDAC - multitier data access engine
 

Re:middleware server

I made my test and a IBDatabase can't be shared between threads, so i'm
updating my Delphi 7 IBX to use IBConnectionBroker, a pool of Connections.
Thanks
Daniel
"Dmitry Arefiev [da-soft.com]" <XXXX@XXXXX.COM>escribio en el mensaje
Quote
>In some circumstances, with InterBase 6.5+, threads can
>share a single TIBDatabase component.

I am expecting, that single server session will serialize requests.
Am I right ?
Regards,
Dmitry

--
Dmitry Arefiev - www.da-soft.com
AnyDAC - Oracle, MySQL, MS SQL, MSAccess, IBM DB2, Sybase
ASA, Interbase/Firebird, DbExpress, ODBC data access engine
ThinDAC - multitier data access engine
 

Re:middleware server

Dmitry Arefiev [da-soft.com] writes:
Quote
I am expecting, that single server session will serialize requests.
Am I right ?
Almost. Requests are serialized, except for asynchronous query
cancellation. The DB connection had to be made thread-safe to allow
this.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: learningtowhistle.blogspot.com
 

Re:middleware server

Quote
Almost. Requests are serialized, except for asynchronous query
cancellation. The DB connection had to be made thread-safe to allow
this.
So, although formally I was not 100% right, but practically I was.
Single thread at DBMS server cannot handle 2 queries in parallel.
So, general rule - **one** connection per **one** thread.
Regards,
Dmitry
--
Dmitry Arefiev - www.da-soft.com
AnyDAC - Oracle, MySQL, MS SQL, MSAccess, IBM DB2, Sybase
ASA, Interbase/Firebird, DbExpress, ODBC data access engine
ThinDAC - multitier data access engine
 

Re:middleware server

Dmitry Arefiev [da-soft.com] writes:
Quote
So, although formally I was not 100% right, but practically I was.
Single thread at DBMS server cannot handle 2 queries in parallel.
As I said in my first reply, I was clarifying the rules, not saying
you were wrong overall.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better? Use QC!
qc.borland.com -- Vote for important issues