ODBC stage -Multiple update statements - Lock

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
premupdate
Participant
Posts: 47
Joined: Thu Oct 04, 2007 3:37 am
Location: chennai

ODBC stage -Multiple update statements - Lock

Post by premupdate »

Gurus,

Job flow

Row generator -----> transformer ------>ODBC stage

I have been trying to update a sybase table.There are multiple update statements.(I had used Row generator and transformer for a dummy purpose)Due to restrictions, we are allowed to use ODBC connector stage where we created DSN for sybase database. I had used all update statements inside a single ODBC stage and the job ran success with few(10) rows.

The actual update records will be in million.If I use full strength of records, is there any chance of getting the table lock error.If so ,how it can be avoided.

Your help most appreciated.

Note: The update statements are written for a same column in same table but with different where clauses.
Cheers,
prem
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can you be a wee bit more specific about what "there are multiple update statements" means exactly?
-craig

"You can never have too many knives" -- Logan Nine Fingers
premupdate
Participant
Posts: 47
Joined: Thu Oct 04, 2007 3:37 am
Location: chennai

Post by premupdate »

Sorry for the delayed reply.

There are some ten update statements for a single table with different where clause and different joins with other tables.

First we thought of using multiple ODBC stages as lookups and process these updates.Keeping performance in mind , all update statements are used in a single stage.
Cheers,
prem
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Since your SQL is within one stage all of the updates in it will be treated as one transaction. For each row that is processed into your ODBC stage how many records are being updated? Also, if you run the job in parallel, could records from one process be updating records from another? This means if you partition on column A with a 4-node job, but the update is done using column B, then you might get lock contention. Your database settings will determine how much rollback space you have for your very large transactions.

If one input record only does 10 updates, each of which only update a single row, then you can control the rollback space usage by setting your job's transaction size accordingly.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Where exactly are these in the stage - in the body of the stage or before/after? I'd also be curious how many update statements will be generating these million updates. However, rather than sitting here and trying to puzzle out exactly what it is you are doing, we can probably just cut straight to the chase - your actual question:
premupdate wrote:If I use full strength of records, is there any chance of getting the table lock error. If so, how it can be avoided.
I can't answer that for Sybase but your DBA can. Take DataStage out of the picture and discuss with them what you are doing and the concerns you have, let them answer your question. You'd also, as Arnd notes, need to bring whatever partitioning you are doing into the conversation as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply