Careful, newby with questions!

Careful, newby with questions!

Post by Hans Gui » Mon, 05 Feb 1996 04:00:00



Hi,

I am currently working on my first Powerbuilder application and there's
something I don't understand about the default transactionobject SQLCA.
Suppose I have two sheets open, both referencing SQLCA, and the user can
make changes to both of them at (more or less) the same time, what would
happen in the following situation:

SHEET1, TABLE1:        SHEET2, TABLE2:

starts processing      starts processing

ROLLBACK

                       COMMIT

At the end, is the data in table 2 rolled back or committed? If it is rolled
back the whole idea of a global transactionobject stops making sense to me.

How do I handle this problem?

---

Another question: before this project I was working on databases written in
Pascal of all things. One of the bigger problems is that I had to deal with
locking of records myself (you can imagine the horror and misery that arose
from this). Although I suspect that Powerbuilder (especially when used on
top of Oracle) handles this well and without my intervention, I must say I'm
worried.

Just how does Powerbuilder handle locking? Is there anything I have to do
myself? Nowhere in the manuals can I find references to locking or handling
error conditions which arise from locking. Surely there is something I'm
overlooking here?

---

And another: I am using a S-Designor for Powerbuilder, and intend to make my
database run on PC's equipped with Windows 95. The database is Oracle 7, and
I'm obviously using Powerbuilder. Are there any obvious pitfalls that I
should beware of?

I apologize if these are 'stupid' questions or if they are clearly explained
in one the manuals, but I am currently trying to become (somewhat)
proficient in all the above tools and I am a bit overwhelmed by the amount
of information I need to understand.

Thanks in advance,

Hans

 
 
 

Careful, newby with questions!

Post by Ken Rea » Tue, 06 Feb 1996 04:00:00



>Hi,

>I am currently working on my first Powerbuilder application and there's
>something I don't understand about the default transactionobject SQLCA.
>Suppose I have two sheets open, both referencing SQLCA, and the user can
>make changes to both of them at (more or less) the same time, what would
>happen in the following situation:

>SHEET1, TABLE1:        SHEET2, TABLE2:

>starts processing      starts processing

>ROLLBACK

>                       COMMIT

>At the end, is the data in table 2 rolled back or committed? If it is rolled
>back the whole idea of a global transactionobject stops making sense to me.

>How do I handle this problem?

>---

First, I can't see how this situation could happen. You can have multiple
sheets open, but only 1 will be active at any given time (it's a Windows
thing). Even if you called your processing for the tables in both sheets
from the same place, your code has to make one process before the other.  
You can use "IF...THEN" constructs to commit either only if both updates
are succesful or rollback both if either fails, but still one update
happens before the other.  There is a world of difference between "at the
same time" and "more or less at the same time".

Lets make sure were using the same terms here. Your tables are how your
data is organized and stored in your database.  In PowerBuilder, what you
see in your window is the DataWindow, or more precisely a DataWindow
object attached to a DataWindow control that sits on a window.

SQLCA, or any transaction object you create yourself, gives your
application information on the data base you're connecting your datawindow
to, or sending embedded SQL to.  SQLCA doesn't specify the tables - any
table in the database you set your transaction object to can be accessed
by your transaction object.  If you want to access data in another
database other than what SQLCA is set to then you need to create another
transaction object.

So, if you had 2 tables in your database and 2 sheets with a datawindow
looking at at 1 table on one, and a datawindow looking at the other table
on the other then your user can bounce back and forth making changes to
whats in either datawindow and nothings changed in your database tables
until you do an update for a datawindow.  Then you can check for success
and decide to commit or rollback.

The point is that SQLCA holds database communication settings and not
table level information.  You use SQLCA on any table in the database, but
your updates to the tables cannot happen simultaneously (although you can
programmaticly make the COMMITS happen simultaneously.

- Show quoted text -

Quote:

>Another question: before this project I was working on databases written in
>Pascal of all things. One of the bigger problems is that I had to deal with
>locking of records myself (you can imagine the horror and misery that arose
>from this). Although I suspect that Powerbuilder (especially when used on
>top of Oracle) handles this well and without my intervention, I must say I'm
>worried.

>Just how does Powerbuilder handle locking? Is there anything I have to do
>myself? Nowhere in the manuals can I find references to locking or handling
>error conditions which arise from locking. Surely there is something I'm
>overlooking here?

>---

>And another: I am using a S-Designor for Powerbuilder, and intend to make my
>database run on PC's equipped with Windows 95. The database is Oracle 7, and
>I'm obviously using Powerbuilder. Are there any obvious pitfalls that I
>should beware of?

>I apologize if these are 'stupid' questions or if they are clearly explained
>in one the manuals, but I am currently trying to become (somewhat)
>proficient in all the above tools and I am a bit overwhelmed by the amount
>of information I need to understand.

>Thanks in advance,

>Hans


 
 
 

Careful, newby with questions!

Post by Mike Swa » Wed, 07 Feb 1996 04:00:00


: Hi,
: I am currently working on my first Powerbuilder application and there's
: something I don't understand about the default transactionobject SQLCA.
: Suppose I have two sheets open, both referencing SQLCA, and the user can
: make changes to both of them at (more or less) the same time, what would
: happen in the following situation:

: SHEET1, TABLE1:        SHEET2, TABLE2:

: starts processing      starts processing

: ROLLBACK

:                        COMMIT

: At the end, is the data in table 2 rolled back or committed? If it is rolled
: back the whole idea of a global transactionobject stops making sense to me.
  Rolled back.

: How do I handle this problem?
  Limit your conversations with the database. You should start your
transaction, do what you have to do, and commit as soon as possible. That
way you don't trip over your own toes, and you minimize locks on the
database.

: Another question: before this project I was working on databases written in
: Pascal of all things. One of the bigger problems is that I had to deal with
: locking of records myself (you can imagine the horror and misery that arose
: from this). Although I suspect that Powerbuilder (especially when used on
: top of Oracle) handles this well and without my intervention, I must say I'm
: worried.

: Just how does Powerbuilder handle locking? Is there anything I have to do
: myself? Nowhere in the manuals can I find references to locking or handling
: error conditions which arise from locking. Surely there is something I'm
: overlooking here?

  PB doesn't handle locking at all. That's the province of the database
engine. Generally, you don't have to worry about it that much, except to
be aware that it exists, and should be minimized.

: And another: I am using a S-Designor for Powerbuilder, and intend to make my
: database run on PC's equipped with Windows 95. The database is Oracle 7, and
: I'm obviously using Powerbuilder. Are there any obvious pitfalls that I
: should beware of?

  Dunno. I use Sybase and MS myself.

--

disclamer: I lie.

 
 
 

Careful, newby with questions!

Post by David Trig » Wed, 07 Feb 1996 04:00:00


Quote:>And another: I am using a S-Designor for Powerbuilder, and intend
>to make my database run on PC's equipped with Windows 95. The
>database is Oracle 7, and I'm obviously using Powerbuilder. Are
>there any obvious pitfalls that I should beware of?

Oracle running on PC's?  Hope you have lots of memory!
 
 
 

1. Be careful, be very careful.

Now for the libelous stuff.

Cyrix is shit, Compaq is shit.

as you can no doubt guess, I have a Compoq Presario 2212 with their
marvelous Cyris Instead motherboard (sound card and video card on the board
to save costs). I bought the machine becuase it was fully upgradeable.

Anyway, got Flight Sim 98 and a MS Force Feedback Joystick off Santa this
Xmas. Everything works fine apart from the Force Feedback (see previous
postings of desperation)

anyway, looking through the Web I thought - Hey, I'll update the drivers.

BANG, No sound, no joystick no fun at all.

Phoned Compaq Presario Helpline here in the UK. Bunch of idiots!

after several "suggestions" I decided to sort it our myself. Cos the card is
amalgamated onto the mother board getting another card is not that easy, so,
being a Welshman I used the usual Welsh tactics of kill the bugger and start
again.

Format c: and restored data.

Bingo, everything works fine but still no FF. I think I'll live with that
until I buy new end of this year.

So, if anyone has a presario 2200, be careful with updating drivers, it can
cost you!

Come and get me Compaq and Cyrix, I'm waiting!

Kevin

2. Group policy for Software installation

3. 5100Cse Newby Question (Repost)

4. PowerPC Mac on schedule?

5. 5100Cse Newby Question

6. pine display ...

7. Newby questions

8. dropped sound in mpeg1 -> mjpeg conversion

9. newby questions

10. Basic NEWBY questions

11. Newby question on using taskSpawn() with a task name string.

12. Newby question on using taskSpawn() with a

13. Newby question - 3D cards