loveneesh
18th June 2008, 21:05
Hi All

Can anybody tell me what should be the value of counter before commiting transaction from a table

Hiba_t
19th June 2008, 08:25
What counter?

Can you explain more? Maybe you can post your code as well...

günther
19th June 2008, 09:00
I guess you mean "how many records can be inserted, updated or deleted before I have to call commit", right? The answer is: It depends .... Typically we use 100 or 1000 for simple update sessions; higher values allow your own session to run a bit faster, but you might slow down all other users because the database has to handle huge transactions.

Keep in mind that a commit transaction is intended to guarantee your data integrity.

Günther

loveneesh
19th June 2008, 09:14
thanks gunther

loveneesh
19th June 2008, 09:36
Hi Gunther,

Actually, I am developing a archiving session. How can I find that how many records should be inserted/deleted before I call commit. is it based on any calculation.

Thanks in advance

günther
19th June 2008, 12:25
For a really good archiving, I would expect that inserting into the archiving company and deleting from the original compay are transactions. So normally only after a completed transaction a commit should be used -- not after counting the insert or delete operations!

Günther

Dikkie Dik
19th June 2008, 12:56
I agree with Günther. It is more important that you don't commit in the middle of a logical transaction. But of course more logical transactions can be done with 1 commit. In case of archive sessions this is not a problem, for OLTP/ Batch sessions where the data is also accessed by other users I advise to commit as soon a logical transaction is done. The amount of records that committed at the same time should not be more than around 500.

Note: If you skip records in your SELECTDO section, commit more frequent. These skipped records stay in memory until the commit. This can lead to huge bshells/drivers and caused several crashes. Try it by selecting records with FOR UPDATE and don't commit these. See the bshell growing (and crashing if to many records where selected).

Hope this helps,
Dick

manojsharma
23rd June 2008, 18:19
Hi All,

I am deleting records from ticpr200 for some cost price codes. I was commiting after 250 records, whenever I run this program, all other operations get slow down, then I changed my program and now I am commiting after every 100 records but the system become very very slow. I can not do other work when this program is running.

Can anybody suggest me what to do.

Thanks in advance

Dikkie Dik
23rd June 2008, 18:22
There is good news and bad news. The good news is that you proved that it is working, the load on the database has Bent increased. The bad news is that your system (most likely your disks) can not handle it any more and block other processes of normal working. Find your bottleneck with some system tools and eliminate these. The elimination is most likely a costly step, but that is life.

Hope this helps,
Dick

manojsharma
24th June 2008, 13:15
hi Dick,

Can you explain what kind of system tools I have to use and how to eliminate these.

Thanks in advance

Dikkie Dik
24th June 2008, 15:58
for UNIX: sar and vmstat can help
for Windows: perfmon can do the job

But for all these tools: you have to know what you are doing so first read the fine manuals of those tools or contact a colleague or internet for help.

Best regards,
Dick

Amit_Baan
29th October 2013, 08:31
Hi Experts.

Can we do commit.transaction in different companies ?

When i'm trying to insert records in a table for different companies, for the first company when record inserted, dal.new() return 0 i.e. no issues, but once I switch the company and try to insert same record in another company without commiting the previous company record, dal.new() returns -12.

Any help is truly appreciated.

Thanks.
Amit

Dikkie Dik
29th October 2013, 08:32
Hi Experts.

Can we do commit.transaction in different companies ?


No this is not possible. You commit everything or nothing.

Dick

Amit_Baan
29th October 2013, 10:12
No this is not possible. You commit everything or nothing.

Dick

Hi,
Thanks for the response.
Do you mean we need to commit record(s) before switching to another company? can not be done at once for multiple companies?
There is no way to achieve this?

Regards,
Amit

Dikkie Dik
29th October 2013, 11:22
Amit,

Youi don't have to commit before doing a company switch.

Doing commit you do:
- at the end of a (set of) logical transaction(s). Example Order header + all related order lines
- to reduce locking. Example: update item by item if these items are constantly locked by other processes as well.

Hope this helps,
Dick

toolswizard
1st November 2013, 22:58
Interesting question:

The Company Number represents a set of tables, changing the company changes the set of tables you are currently working with. So the commit may not work.

Have you tried instead of changing the company number put in a where clause so that ppmmmxxx._compnr = 100 (or what ever company you are using)

Also have you checked to make sure that both companies have the same package combination? Did you use switch.to.company or compnr.check? Are you a super user or normal user?