Solved

Powerbuilder Datawindow Locking Issue

Posted on 2006-07-10
6
1,773 Views
Last Modified: 2013-12-26
Greetings All,

Okay, it is easy to create a PB applications.  But now that I am rolling them out, they seem to hang with the hourglass.

In one instance I have two versions of the application running on the same odbc connection.  The first starts fine.  The second application hangs.  Is this to be expected?

Likewise, all of the users have a VB application that uses ODBC DSN 'number 1'  

The powerbuilder application that I am giving them accesses the same ODBC DSN 'number 1'

It seems to work.

Can someone offer some guidelines for managing the datawindows to avoid conflicts?  I don't want to roll out the application only to find that having a third user causes trouble.

The ODBC driver is a system dsn that accesses SQL Server via Named Pipes.  (they are already set up on every system).

Thanks!!

PEM
0
Comment
Question by:pemurray
6 Comments
 
LVL 5

Assisted Solution

by:michaelstoffel
michaelstoffel earned 166 total points
Comment Utility
Make sure autocommit is set to TRUE on the transaction object and explicitly start and end your transactions.  You may be experiencing database locks.

Mike
0
 
LVL 4

Assisted Solution

by:Lordain
Lordain earned 166 total points
Comment Utility
Is your database set up to allow a connection pool and are you using it?  Does each user have their own database account?
0
 

Author Comment

by:pemurray
Comment Utility
Gentlemen,

I am not in the office right now so I will have to check the settings.  But the application uses a system odbc driver (as does the other application).  The odbc driver connects to SQL Server via Windows NT Authentication for each user.

Thanks!!

PEM
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:pemurray
Comment Utility
Michael,

Your suggestion to turn autocommit to true and explicitly start and end the transactions seems to be at odds with the help (shown below):

SQLCA.AutoCommit = value

Parameter      Description value: Specifies whether PowerBuilder issues SQL statements outside or inside the scope of a transaction. Values are:

True  PowerBuilder issues SQL statements outside the scope of a transaction. The statements are not part of a logical unit of work (LUW). If the SQL statement is successful, the DBMS updates the database immediately as if a COMMIT statement had been issued.·

False  (Default) PowerBuilder issues SQL statements inside the scope of a transaction. PowerBuilder issues a BEGIN TRANSACTION statement at the start of the connection and issues another BEGIN TRANSACTION statement after each COMMIT or ROLLBACK statement is issued.

It seems like if I leave it as False, PB will handle the BEGIN, COMMIT or ROLLBACK for me.

What do you think?

To: Lordain,

There is a connection pooling tab on the odbc driver that has a default retry time of 120 for SQL Server.

Thanks!!

PEM
0
 

Author Comment

by:pemurray
Comment Utility
More...

It seem pretty apparent that my application is causing the users of the other application that accesses the same database to get an SQL Runtime Error 40002.

I can see that I am not going to be able to run this application until I do some more research.  Of course the other program was written in VB and the developers probably thought they would have sole access to the database.  But still, it is a multi-user app and there were no runtime errors until I rolled out my application (which I pulled back).

Thanks!

PEM
0
 
LVL 4

Accepted Solution

by:
batchakamal earned 168 total points
Comment Utility
Use SetTransPool function and make sure u use,

SQLCA.Lock = "Exclusive"

Bye
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now