Do database calls to MS/SQL via ODBC block?

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Do database calls to MS/SQL via ODBC block?

Postby PhotonDemon » Tue Dec 07, 2010 10:40 am

Hi All,

Can anyone tell me if database calls to MS/SQL via ODBC block other forks?

Lou
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: Do database calls to MS/SQL via ODBC block?

Postby waynej » Tue Dec 07, 2010 2:37 pm

Blocking would be terrible for our application. See references to AllCallsThreaded, and also implementors of #allCallsThreaded*.
waynej
 
Posts: 32
Joined: Wed Apr 18, 2007 9:18 am

Re: Do database calls to MS/SQL via ODBC block?

Postby PhotonDemon » Thu Dec 09, 2010 7:28 am

Hi Wayne,

It seems the default is that the database calls are not threaded and therefor do block. From your note:

Blocking would be terrible for our application. See references to AllCallsThreaded, and also implementors of #allCallsThreaded*.


it seems that you change the default so all database calls are threaded. Is this the case and can you tell me if there is anything I should know before I try this myself?

Thanks, Lou
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: Do database calls to MS/SQL via ODBC block?

Postby waynej » Thu Dec 09, 2010 7:42 am

Right, we change the preference such that we thread database calls, so a database call can run concurrently with other things including other database calls.

It works fine, but it may open your application to concurrency problems you will have to think about. We did it so long ago, I forget what other hurdles you may face.
waynej
 
Posts: 32
Joined: Wed Apr 18, 2007 9:18 am

Re: Do database calls to MS/SQL via ODBC block?

Postby PhotonDemon » Thu Dec 09, 2010 11:16 am

Hi Wayne,

Thanks for the info. One more question. I assume that with the database calls set to be threaded, that the fork that calls the database will block for the duration of the call but that other forks will continue?

If this is the case, my code should be fine. I don't make more than one database call from more than one fork at the same time. But having forks that don't make database calls be able to run will be nice.

Lou
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
PhotonDemon
[|]
 
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: Do database calls to MS/SQL via ODBC block?

Postby waynej » Thu Dec 09, 2010 11:28 am

Right, Lou.
waynej
 
Posts: 32
Joined: Wed Apr 18, 2007 9:18 am

Re: Do database calls to MS/SQL via ODBC block?

Postby marten » Thu Dec 09, 2010 12:18 pm

PhotonDemon wrote:Hi Wayne,

Thanks for the info. One more question. I assume that with the database calls set to be threaded, that the fork that calls the database will block for the duration of the call but that other forks will continue?

If this is the case, my code should be fine. I don't make more than one database call from more than one fork at the same time. But having forks that don't make database calls be able to run will be nice.

Lou


They use static future calls (the external call is always done by the same external native thread) - because some databases MUST be called from the SAME thread (they started the connection with ...) every time - or have other limitations.
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron