Skip to main content

[archive] Transaction Management -- Log file?

  • July 26, 2010
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 23 July 2010]

I am trying to turn on acuCOBOL "Transaction Management".

So I did the following:

1. Add "LOCK MODE" to my current index files, eg.
SELECT FILEHELLO
ASSIGN TO "file1.dat"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS FILEHELLO-KEY
LOCK MODE IS AUTOMATIC WITH ROLLBACK | new add line
FILE STATUS IS FILEHELLO-STATUS.

2.Add new entry in my runtime configuration file, eg.
#transaction temporary file directory
LOG-DIR c:\\DATA\\transaction-tmp
#log file definitions
file1-LOG file1.log
... ...

#default log file definition
LOG-FILE default.log

3. In my source code add
TRANSACTION-ERROR SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON TRANSACTION.
... ...

4. In my source code add
FILEHELLO-ERROR SECTION.
USE AFTER ERROR PROCEDURE ON FILEHELLO.
PROCESS-FILEHELLO-ERROR.
IF FILEHELLO-STATUS = 99 THEN |record locked
IF WITHIN-TRANSACTION THEN
ROLLBACK TRANSACTION
... ...
END-IF
... ...
END-IF.

5.Create physical deirectory "c:\\DATA\\transaction-tmp"

6. Add START TRANSACTION and COMMIT TRANSACTION in my source code, eg.
...
START TRANSACTION.
OPEN I-O FILEHELLO.
...
REWRITE FILEHELLO-RECORD.
CLOSE FILEHELLO.
OPEN I-O FILEWORLD.
...
REWRITE FILEWORLD-RECORD.
CLOSE FILEWORLD.
...
COMMIT TRANSACTION.
...

7. I run my application, I see
In folder "transaction-tmp", I could not see the defined log file "file1.log" being created, why ?
Under debug mode, I see a temporary file created such as "TMxfsqq0"; when the debug finished, this temporary file were gone.

Do I forget something to set up , why the log files are not created automatically?


Any advice will be highly appreciated!

4 replies

[Migrated content. Thread originally posted on 23 July 2010]

I am trying to turn on acuCOBOL "Transaction Management".

So I did the following:

1. Add "LOCK MODE" to my current index files, eg.
SELECT FILEHELLO
ASSIGN TO "file1.dat"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS FILEHELLO-KEY
LOCK MODE IS AUTOMATIC WITH ROLLBACK | new add line
FILE STATUS IS FILEHELLO-STATUS.

2.Add new entry in my runtime configuration file, eg.
#transaction temporary file directory
LOG-DIR c:\\DATA\\transaction-tmp
#log file definitions
file1-LOG file1.log
... ...

#default log file definition
LOG-FILE default.log

3. In my source code add
TRANSACTION-ERROR SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON TRANSACTION.
... ...

4. In my source code add
FILEHELLO-ERROR SECTION.
USE AFTER ERROR PROCEDURE ON FILEHELLO.
PROCESS-FILEHELLO-ERROR.
IF FILEHELLO-STATUS = 99 THEN |record locked
IF WITHIN-TRANSACTION THEN
ROLLBACK TRANSACTION
... ...
END-IF
... ...
END-IF.

5.Create physical deirectory "c:\\DATA\\transaction-tmp"

6. Add START TRANSACTION and COMMIT TRANSACTION in my source code, eg.
...
START TRANSACTION.
OPEN I-O FILEHELLO.
...
REWRITE FILEHELLO-RECORD.
CLOSE FILEHELLO.
OPEN I-O FILEWORLD.
...
REWRITE FILEWORLD-RECORD.
CLOSE FILEWORLD.
...
COMMIT TRANSACTION.
...

7. I run my application, I see
In folder "transaction-tmp", I could not see the defined log file "file1.log" being created, why ?
Under debug mode, I see a temporary file created such as "TMxfsqq0"; when the debug finished, this temporary file were gone.

Do I forget something to set up , why the log files are not created automatically?


Any advice will be highly appreciated!
In your runtime configuration file please set:

LOGGING 1

:-)

[Migrated content. Thread originally posted on 23 July 2010]

I am trying to turn on acuCOBOL "Transaction Management".

So I did the following:

1. Add "LOCK MODE" to my current index files, eg.
SELECT FILEHELLO
ASSIGN TO "file1.dat"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS FILEHELLO-KEY
LOCK MODE IS AUTOMATIC WITH ROLLBACK | new add line
FILE STATUS IS FILEHELLO-STATUS.

2.Add new entry in my runtime configuration file, eg.
#transaction temporary file directory
LOG-DIR c:\\DATA\\transaction-tmp
#log file definitions
file1-LOG file1.log
... ...

#default log file definition
LOG-FILE default.log

3. In my source code add
TRANSACTION-ERROR SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON TRANSACTION.
... ...

4. In my source code add
FILEHELLO-ERROR SECTION.
USE AFTER ERROR PROCEDURE ON FILEHELLO.
PROCESS-FILEHELLO-ERROR.
IF FILEHELLO-STATUS = 99 THEN |record locked
IF WITHIN-TRANSACTION THEN
ROLLBACK TRANSACTION
... ...
END-IF
... ...
END-IF.

5.Create physical deirectory "c:\\DATA\\transaction-tmp"

6. Add START TRANSACTION and COMMIT TRANSACTION in my source code, eg.
...
START TRANSACTION.
OPEN I-O FILEHELLO.
...
REWRITE FILEHELLO-RECORD.
CLOSE FILEHELLO.
OPEN I-O FILEWORLD.
...
REWRITE FILEWORLD-RECORD.
CLOSE FILEWORLD.
...
COMMIT TRANSACTION.
...

7. I run my application, I see
In folder "transaction-tmp", I could not see the defined log file "file1.log" being created, why ?
Under debug mode, I see a temporary file created such as "TMxfsqq0"; when the debug finished, this temporary file were gone.

Do I forget something to set up , why the log files are not created automatically?


Any advice will be highly appreciated!
In your runtime configuration file please set:

LOGGING 1

:-)



Tried , but no luck...

[Migrated content. Thread originally posted on 23 July 2010]

I am trying to turn on acuCOBOL "Transaction Management".

So I did the following:

1. Add "LOCK MODE" to my current index files, eg.
SELECT FILEHELLO
ASSIGN TO "file1.dat"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS FILEHELLO-KEY
LOCK MODE IS AUTOMATIC WITH ROLLBACK | new add line
FILE STATUS IS FILEHELLO-STATUS.

2.Add new entry in my runtime configuration file, eg.
#transaction temporary file directory
LOG-DIR c:\\DATA\\transaction-tmp
#log file definitions
file1-LOG file1.log
... ...

#default log file definition
LOG-FILE default.log

3. In my source code add
TRANSACTION-ERROR SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON TRANSACTION.
... ...

4. In my source code add
FILEHELLO-ERROR SECTION.
USE AFTER ERROR PROCEDURE ON FILEHELLO.
PROCESS-FILEHELLO-ERROR.
IF FILEHELLO-STATUS = 99 THEN |record locked
IF WITHIN-TRANSACTION THEN
ROLLBACK TRANSACTION
... ...
END-IF
... ...
END-IF.

5.Create physical deirectory "c:\\DATA\\transaction-tmp"

6. Add START TRANSACTION and COMMIT TRANSACTION in my source code, eg.
...
START TRANSACTION.
OPEN I-O FILEHELLO.
...
REWRITE FILEHELLO-RECORD.
CLOSE FILEHELLO.
OPEN I-O FILEWORLD.
...
REWRITE FILEWORLD-RECORD.
CLOSE FILEWORLD.
...
COMMIT TRANSACTION.
...

7. I run my application, I see
In folder "transaction-tmp", I could not see the defined log file "file1.log" being created, why ?
Under debug mode, I see a temporary file created such as "TMxfsqq0"; when the debug finished, this temporary file were gone.

Do I forget something to set up , why the log files are not created automatically?


Any advice will be highly appreciated!
When exception happend, the transaction rollback works.

But only the log files are not created in the transaction log folder?

The help says:

"The runtime creates that log file, or opens the existing one, as part of the first START TRANSACTION statement. Log files specified with filename-LOG variables are created or opened when the file whose base name is filename is opened OUTPUT or I/O for the first time in the program."

[Migrated content. Thread originally posted on 23 July 2010]

I am trying to turn on acuCOBOL "Transaction Management".

So I did the following:

1. Add "LOCK MODE" to my current index files, eg.
SELECT FILEHELLO
ASSIGN TO "file1.dat"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS FILEHELLO-KEY
LOCK MODE IS AUTOMATIC WITH ROLLBACK | new add line
FILE STATUS IS FILEHELLO-STATUS.

2.Add new entry in my runtime configuration file, eg.
#transaction temporary file directory
LOG-DIR c:\\DATA\\transaction-tmp
#log file definitions
file1-LOG file1.log
... ...

#default log file definition
LOG-FILE default.log

3. In my source code add
TRANSACTION-ERROR SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON TRANSACTION.
... ...

4. In my source code add
FILEHELLO-ERROR SECTION.
USE AFTER ERROR PROCEDURE ON FILEHELLO.
PROCESS-FILEHELLO-ERROR.
IF FILEHELLO-STATUS = 99 THEN |record locked
IF WITHIN-TRANSACTION THEN
ROLLBACK TRANSACTION
... ...
END-IF
... ...
END-IF.

5.Create physical deirectory "c:\\DATA\\transaction-tmp"

6. Add START TRANSACTION and COMMIT TRANSACTION in my source code, eg.
...
START TRANSACTION.
OPEN I-O FILEHELLO.
...
REWRITE FILEHELLO-RECORD.
CLOSE FILEHELLO.
OPEN I-O FILEWORLD.
...
REWRITE FILEWORLD-RECORD.
CLOSE FILEWORLD.
...
COMMIT TRANSACTION.
...

7. I run my application, I see
In folder "transaction-tmp", I could not see the defined log file "file1.log" being created, why ?
Under debug mode, I see a temporary file created such as "TMxfsqq0"; when the debug finished, this temporary file were gone.

Do I forget something to set up , why the log files are not created automatically?


Any advice will be highly appreciated!
Find the reason:

The log was actually created in my "/objects" folder rather than the folder which I indicated "c:\\DATA\\transaction-tmp".

After several experiments, I finally make it by changing the config as:

#transaction temporary file directory
LOG-DIR c:\\DATA\\transaction-tmp
#log file definitions
file1-LOG c:\\DATA\\transaction-tmp\\file1.log
... ...

#default log file definition
LOG-FILE c:\\DATA\\transaction-tmp\\default.log


Thanks Dilbert.