1. Konstantin Goldobin
  2. PowerBuilder
  3. Thursday, 4 April 2024 10:41 AM UTC

Hello,

I created a small test application that emulates the way a real application works with the Oracle DB (using multiple transaction objects). After I'd deployed it to PowerServer and run it, I got an error message "Connection request timed out" in SQLErrText of a transaction object after calling the connect statement. I'm a little lost as to how to troubleshoot this.

I may guess that it's either that the webserver can't connect to the Oracle server or that there's something wrong in my transaction to cache mappings. But I don't really know how to test that the webserver can connect to the Oracle DB using the data I entered in the cache definition. It's a clean PC with no Oracle client installed, so I can't use the usual tnsping/sqlplus checks. Besides, that wouldn't help understanding whether the webserver can connect using the Oracle .NET Core driver and the data from the cache settings. Could someone suggest how to do this before looking into transaction to cache mapping?

Best regards,
Konstantin

Konstantin Goldobin Accepted Answer Pending Moderation
  1. Thursday, 4 April 2024 11:45 AM UTC
  2. PowerBuilder
  3. # 1

OK, replying to my own question. The health-ui page shows that the webserver to DB server connection works:

 

That brings me to the second question: transaction to cache mapping. What I didn't understand was what exactly "transaction object name" is. All examples in the help that I've seen so far use sqlca, so it seems to be a name of a variable of the transaction data type. I was trying to make the following script work:

transaction ltr_trans

ltr_trans = create transaction
if f_connect_trans_object( ltr_trans) then parent.triggerEvent( 'ue_connected')


global function boolean f_connect_trans_object (transaction atr_trans);
if f_init_trans_object( atr_trans) then
	connect using atr_trans;
	if atr_trans.sqlcode <> 0 then
		messageBox( 'Error connecting to the database', atr_trans.sqlErrtext, stopsign!)
		return false
	else
		return true
	end if
else
	messageBox( 'Error', 'Error reading DB credentials from the INI file', stopsign!)
	return false
end if

end function

Initially, I used ltr_trans but it didn't work. After I added atr_trans as well, the app successfully connected.

What I would appreciate is more detailed explanation of which transaction object variables need to be mapped to caches. I don't seem to be able to find it in PowerServer help. Thanks!

Comment
  1. Chris Pollach @Appeon
  2. Friday, 5 April 2024 14:05 PM UTC
Hi Konstantin;

It should not matter what Transaction object name your application uses. The key concept here is that PowerServer maps all DBMS / DB Instance access via it's "CacheName" setting in the PS project. Therefore, your PB App transaction objects should *always* set this mapping their TRansaction Objects DBParm filed as follows....

For example: <MyTrans>.DBParm="CacheName='mycache'"

Following this rule, PS will ignore the Transaction Object name and just concentrate on the CacheName mapping - which should always be used to ensure proper DBMS / DB instance redirection in the middle tier.(IMHO). Just my $0.02 HTH

Regards .. Chris

  1. Helpful
  1. Konstantin Goldobin
  2. Tuesday, 9 April 2024 13:43 PM UTC
Hi Chris,



It's an interesting thought. I was hoping to get by with a static mapping so that I don't have to change all the places where transaction objects are created and initialized. Is this setting ignored by a traditional C/S application? (I seem to be very bad at using PS Help: I can't find answers to my questions there...)



I'm also trying to figure out an easy way of switching a client app between different databases (dev, test, different production instances). All I have found so far involves changes on the server side...



Regards,

Konstantin
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 9 April 2024 17:57 PM UTC
Hi Konstantin;

That is exactly whet the CacheName setting is used for ... SQLCA.DBParm="CacheName='mydbcache'"

Where "mydbcache" value changes by the production DB instance that you need to have PS server connect to for a specific App user. ;-)

Regards .. Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 4 April 2024 14:12 PM UTC
  2. PowerBuilder
  3. # 2

HI Konstantin ;

  The issue is most likely in the middle tier (aka PowerServer) and not your Web Server. The WS would only be used as a deployment vehicle for your PS based PB App EXE & resources. Once the PB App starts on the client machine, the PB App will use HTTP(s) to communicate directly to PS for DML processing requests. It's PS that will be performing all the DML activity with your DBMS. So in your PS project within the PB IDE where you set-up the "DB Cache" for your Transaction object is where the DB timeouts settings are defined. So I would suggest that you review those for appropriate timeout values for you Oracle environment & app processing.

  Note that in PB 2022 R3 you can now use the LongConnection setting to over-ride your DB Cache settings in PS when a PB App needs extra DBMS time.

For example ...

SQLCA.DBParm = "LongConnection=1"

HTH

regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.