1. Jonathan Meltzer
  2. PowerBuilder
  3. Tuesday, 3 November 2020 19:24 PM UTC

It used to be that you could put "TRACE SNC" into the DBMS field in an ini file, and that would work to start a trace going when the application was launched.  However, when I do that in PB 2019, I get "DBMS TRACE SNC is not supported in your installation".  

What is the supported way for the end user to run a trace to find an issue?  We use an ini file for our database connection parameters.  Or is this actually the way to run the trace, and there is a deeper issue somewhere in the code?

Thanks,

Jonathan

Accepted Answer
Jonathan Meltzer Accepted Answer Pending Moderation
  1. Tuesday, 10 November 2020 18:24 PM UTC
  2. PowerBuilder
  3. # Permalink

This has been solved.  The issue was that the version of the PBTRA190.dll and PBTRS190.DLL was incorrect.  I think I was trying to use the 64-bit versions instead of the 32-bit versions (our app is 32-bit).  When I got the correct DLLs into my application directory, I was able to do the trace.

I thank you for the time and effort.  If you see someone having a similar problem, maybe they can find this solution and it will help them too.

Thanks,

Jonathan

Comment
  1. Armeen Mazda @Appeon
  2. Tuesday, 10 November 2020 18:32 PM UTC
Thanks for sharing the solution!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 12 November 2020 20:02 PM UTC
Awesome! Glad that you discovered the bitness mismatch. That would explain it!
  1. Helpful
There are no comments made yet.
Jonathan Meltzer Accepted Answer Pending Moderation
  1. Monday, 9 November 2020 20:53 PM UTC
  2. PowerBuilder
  3. # 1

I have verified that tracing works in my development environment, both with TRACE SNC in the config file and with setting the SQLCA.DBMS value to "TRACE SNC" directly in the code.

So, the difference is the library list in the development environment vs. the library list when the app is deployed, I guess.  Adding the PBTRA and PBTRS DLL files did not make the difference.  I do not want to send all of the DLLs to the user, as the app directory is being kept lean on purpose (plus, for all I know, the issue he is running into may involve the libraries, so I do not want to obfuscate the issue).  

So...for tracing, are there any other DLL files that are needed?  I have no problem adding them in ones and twos, if someone can point me to the likely culprit.

Thanks,

Jonathan

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Friday, 6 November 2020 01:06 AM UTC
  2. PowerBuilder
  3. # 2

I might be totally wrong, but I'm not sure if tracing on sql server might be obsolete now:

https://docs.microsoft.com/en-us/sql/relational-databases/sql-trace/sql-trace?view=sql-server-ver15

You'd have to use something like this: https://docs.microsoft.com/en-us/sql/relational-databases/extended-events/quick-start-extended-events-in-sql-server?view=sql-server-ver15

 

Or .. maybe you could you get some more information by simply using the activity monitor of "SQL Server Management Studio"?

HIH

Comment
  1. Jonathan Meltzer
  2. Monday, 9 November 2020 13:53 PM UTC
Thank you for the thought. The idea is to allow a single user to trace the SQL being run in their session. The problem we are having is that the application is acting as though record changes are being saved (even writing to a history table to reflect the changes) but the changes are not always being saved. It is tough to replicate, but the user thinks that he can make it happen. So we want to trace just his session to see if we can catch what might be happening. It has been happening to many users, but it is not easy to replicate on demand. The application code has not changed in a long time, but we did upgrade from 10.5 to 12.5 to 2017 to 2019 over the last several years.



If you know of a better way to get the trace of a session to see why this might not be working correctly (it is only in one datawindow/table, as far as I know), I am all ears.
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 9 November 2020 14:12 PM UTC
Well you could maybe use the sqlpreview event of the datawindow or transaction object (if you use a custom transaction object), but you'd have to compile and give the user a new version of the application. In the event sqlpreview you'd have to write your own log file.

So maybe you are missing a COMMIT somewhere or maybe the user might close some window in a non expected way, like with CTRL / ALT -F4 or by using the right cross in upper right corner or the ESC key if there's a button with the "Cancel" attribute checked and a Rollback happens somewhere before doing the needed commit.

I'm not sure if a COMMIT / Rollback is logged by the sqlpreview of a transaction object.

If your are using PFC's and you're lucky that everywhere an "sqlca.of_commit()" is done instead of "commit", you could also add logging to that function (and of_rollback() of course).



Frankly your best option would be to get the DBMS = "TRACE SNC ..." to work. Could it be the user is getting the connection parameters for somewhere else than expected and therefore the trace doesn't work?

regards
  1. Helpful
  1. Miguel Leeuwe
  2. Monday, 9 November 2020 14:17 PM UTC
From: https://docs.appeon.com/pb2019r2/connecting_to_your_database/ch15s02.html#d0e9354

"Using the Database Trace tool with one connection"

You can use the Database Trace tool for only one DBMS at a time and for one database connection at a time.

For example, if your application connects to both an ODBC data source and an Adaptive Server Enterprise database, you can trace either the ODBC connection or the Adaptive Server Enterprise connection, but not both connections at the same time.



Could this be the problem maybe?

  1. Helpful
There are no comments made yet.
Jonathan Meltzer Accepted Answer Pending Moderation
  1. Thursday, 5 November 2020 14:40 PM UTC
  2. PowerBuilder
  3. # 3

Added both the pbtra190.dll and pbtrs190.dll to the executable directory, and am getting the same error as before.  Maybe I am missing something simple?  Is there a chance that we could do a WebEx or something?  I have a user who is willing to trace their session to find/resolve an issue, but I need to get them a way to do it.

Thanks,

Jonathan

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 5 November 2020 15:44 PM UTC
Hi Jonathan;

For this type of "live" support from Appeon you can create a "Premium" (paid) support ticket. This would automatically activate one-on-one support and allow a support representative to help you directly with design, coding, debugging, etc questions / issues of your particular application. Note that any support ticket only handles one question / problem.

For other PB customers, MVP's etc that participate in this forum - they might take you up on your suggestion for a live session. As these people are not Appeon employees, they are welcome to do so on their own availability.

Regards ... Chris
  1. Helpful
  1. Jonathan Meltzer
  2. Thursday, 5 November 2020 17:13 PM UTC
OK, fair enough. Do you have any suggestions as to why just adding those DLLs did not work? Is there another setting that I should be looking at?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 5 November 2020 19:20 PM UTC
That is very weird indeed. Noramally, those two DLL's if they are missing would be the issue.

Suggestion#1 - Run the PB App EXE "As Admin" and see if that works tracing wise.

Suggestion#2 - Copy all the DLL's in the PB IDE's "Shared" folder to the deployment PC where the EXE resides.
  1. Helpful
There are no comments made yet.
Jonathan Meltzer Accepted Answer Pending Moderation
  1. Tuesday, 3 November 2020 21:18 PM UTC
  2. PowerBuilder
  3. # 4

I just tried adding that file to my runtime directory, and then using TRACE SNC as the DBMS in the ini file...same error message as before. Does the DLL need to be compiled with the app at compile time or something? Thank you for the help...hopefully we can get there.

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 3 November 2020 22:01 PM UTC
No ... as long as it finds that DLL, the SQL Trace should work.

Also, try adding the "PBTRS190.dll" runtime file as well to the deployed App's exe machine.\
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 3 November 2020 19:31 PM UTC
  2. PowerBuilder
  3. # 5

Hi Jonathan;

  Yes, you need to make sure that you also deploy the PBTRA190.dll with your PB run-time to the PB App's deployment machine. That is the module that supports the SQL tracing. 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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.