1. Brad Howie
  2. PowerBuilder
  3. Wednesday, 10 March 2021 00:49 AM UTC

I support a mature application using PowerBuilder 2017 R3 and SQL Server via ADO.Net.

Our user community recently requested we add signatures onto some of our datawindow documents.  The 'tableblob' datawindow object seems perfect for this, but unfortunately it doesn't seem to work when MultipleActiveResultSets=FALSE in the database connection ProviderString.  Our application requires MultipleActiveResultSets=FALSE, so I'm not sure how to get around this.  The error I receive from the datawindow preview painter is: 

"There is already an open DataReader associated with this Command which must be closed first".

Running a database trace against the datawindow retrieval shows that this error occurs after the initial datawindow data is retrieved, when it is trying to retrieve the tableblob blob data from the database.

If I set MultipleActiveResultSets=TRUE, everything works perfectly - the datawindow displays the blob image stored in the database as expected.  Unfortunately, this is not an option.

I also noticed that the 'PrintDataWindow' function will crash when trying to print the datawindow with the tableblob - we have a few areas in the application where this function is used.  This is unrelated to the MARS issue.

Is there a workaround that will allow me to display the blob image on the datawindow, when MultipleActiveResultSets=FALSE ?  I'd prefer not to change database drivers, if possible.  Using files is also not an option, we need to have the images/signatures stored in the database.

Thanks,

Brad

 

 

 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 10 March 2021 16:37 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Brad;

  How about using a 2nd Transaction Object just for BLOB processing?

Regards ... Chris

Comment
There are no comments made yet.
Brad Howie Accepted Answer Pending Moderation
  1. Monday, 15 March 2021 22:48 PM UTC
  2. PowerBuilder
  3. # 1

Hi Chris,

I was able to resolve the issue with the PrintDataWindow function crashing once I added the TableBlob to the datawindow.  It was due to using ShareData between datawindows - this doesn't seem to work well when the datawindows have a TableBlob.  I removed all ShareData calls and retrieved each datawindow independently, and everything worked perfectly.

Thanks again for your assistance!

Brad

Comment
  1. Chris Pollach @Appeon
  2. Monday, 15 March 2021 23:10 PM UTC
Hi Brad ... Thanks for the feedback. That is great news! :-)
  1. Helpful
There are no comments made yet.
Brad Howie Accepted Answer Pending Moderation
  1. Wednesday, 10 March 2021 22:59 PM UTC
  2. PowerBuilder
  3. # 2

Hi Chris,

Thank you for the suggestion - great idea.  I tried this out, and it does indeed resolve the issue.  It's not the most elegant, but I'll take it!

Do you have any thoughts on the 'PrintDataWindow' function crashing when the datawindow contains a TableBlob?

Thanks,

Brad

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 11 March 2021 00:19 AM UTC
Hi Brad;

Yes, sometimes the not-so-elegant solution that works is the best. ;-)

I wonder if somehow, your Blob processing is cutting off the data stream prematurely? Thus, a corrupt print image.

Did you set the PBMaxBlobSize parameter to accommodate the largest Blob size return value?

Regards ... Chris
  1. Helpful
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.