The place for peer-to-peer support for VPM Enterprise 9.1, our latest framework.


Postby btiguy » Sun Aug 20, 2017 12:42 pm

I think datasessions are driving me nuts, cuz I don't understand how they work. I have a form call a routine in a class that creates a cursor table. Then the another routine is called from the first form to populate the cursor. Then another form wants to use the cursor, but it's in a different datasession. I have a statement to check that the cursor exsits, which it does, then I select it, but since it's in another session, I can select it.

Is there a simple way to handle this stuff? I often create a cursor that I want to use in another form and this problem makes it impossible.
Posts: 451
Joined: Mon Jun 21, 2010 4:03 pm

Re: Datasessions

Postby stecenko » Sun Aug 20, 2017 1:44 pm

The 1st form (let's call it the master form) has datasession set to 2, i.e. private, as does the 2nd form (let's call it the slave form).

What happens in a data session stays in a data session.

Why does the slave form require a private data session?

Is it always called from the master form or is it sometimes called from the menu? If it is always called from the master form, is it modal?

If the slave form is never called from the menu, then you can set it's datasession to 1, i.e. default which means use the existing data session in the master form. And set the slave to modal so the user has to exit from it before any further processing can occur.

If the slave is called from the menu, then it isn't really a slave. So you'll have to it in half.

The first half of the slave is private and in that data session, you open the views and tables; in other words, this is another master.

The 2nd half of the old slave remains a slave and its data session is default. It is always called from some master and doesn't care which because the master form creates the proper environment (the data session) for the slave to do its job.

You can see the problem arises when you create a form that is both a master and slave. Now in capitalist societies, a person can be a master to employees and simultaneously a slave to 'bankers and the damn CPR.' But in object oriented programming that's an anomaly, which is driving you nuts.
Richard Stecenko
Interactive Computer Services Inc.
Winnipeg, Manitoba
Posts: 756
Joined: Mon Jun 21, 2010 8:06 pm
Location: Winnipeg, Canada

Return to VPM Enterprise 9.1

Who is online

Users browsing this forum: No registered users and 1 guest