Question

How to make database connection pool in PowerBuilder (v9+) with...

  • ...ODBC?
  • ...SQL Server?
  • ...Oracle?
Was it helpful?

Solution

Unfortunately, at least with PB 9, you can't natively. PB has always been a two-tier dev tool. However, if you are using the WebServices support that started in PB 9 you can get around this limitation by invoking WebServices on a connection pooled appServer. I haven't played with PB 11.5 yet BTW. Could be different there.

Jason

OTHER TIPS

At this risk of self-promotion, these may get you started for Oracle:

If you go to Sybase Manuals (intuitive, eh? ), go to the Connecting to Your Database manual for the version you're looking at, a search for "pool" may be productive. Looking at my local copy for 11.5, I can see references to SNC (MS) and ODBC.

As far as "non-native" approaches, I'm guessing Jason might have been referring to connection pooling with an application server, then getting your data through that.

Good luck.

With PowerBuilder version 9 and up using the Oracle native driver and connecting to Oracle 9i and above databases, you can tell Oracle to maintain connections in a pool using the CnnPool='Yes' database parameter:

Additional info from the PB 11.1 docs: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc33820_1110/html/dbparm/BJEBJADI.htm

I don't believe that

CnnPool='Yes'

was supported officially in PB 9.

I'm not sure that most PB developers are all that familiar with how to deal with pools.

ASP.Net's approach is simple and straight forward at least compared to my experience with some Java app servers. (Please don't start a flame war on that last sentence, I said my experience).

I have written a "server" application that received PB datastores that were executed for ds.retrieve() and ds.update() and passed the data back to the client PB app. It was a way to pool. The server application would open multiple connections... I did this in PB 8 (there's a book out there somewhere). I wouldn't recomment this approach... lot's of code.

In PB 11.x, there are some cool new approaches that you should consider.

@Jason Vogel...

You said I can't do natively ...so there is an alternative way to do it?

/* Declare as an instance variable*/

n_to_server i_to_server //Transaction Object alternative to SQLCA, i_to_server is a custom name as is n_to_server

/* Instatiate connection object*/

i_to_server = CREATE transaction //Was declared in the instance variables from n_to_server

i_to_server.DBMS = "ODBC"

i_to_server.AutoCommit = TRUE

i_to_server.DBParm = "ConnectString='DSN=SourceServer;UID=username;PWD=password'"

CONNECT USING i_to_server ;

SELECT @@trancount INTO :li_TranCount

FROM sysobjects

WHERE name = 'sysobjects'

USING i_to_server ; //Must have USING in transactions that are not using SQLCA (the native transaction)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top