Welcome Guest ( Log In | Register )


 
Reply to this topicNew Topic
XIB MBC invalid database connections failure
bluefisher80
post Sep 27 2009, 01:55 AM
Post #1


Visitor
*

Group: Members
Posts: 5
Joined: 23-June 09
Member No.: 576


My XIB integration is like this:
Receive Activity->Coded MBC(this mbc open the input EDI message, parse it, and open a database connection and put the data into database).

But if i input several input files for the receive activity, around 10% of the time, the MBC process those files in parallel, and most of the cases of the 10%, the MBC will fail cause of DATABASE connection error.
part of the mbc:
Database OPEN "user/password@SID" DBID $DBID,
.....
....
DATABASE EXECUTE "COMMIT"

According to the Trace view log, the MBC tries to open the DATABASE almost the same time, and
if print the $DBID, it will show two different values, most of the time, the first one is 0, and the next one is a positive integer.
But for the latter one, when EXECUTE "COMMIT", the MBC will through exectpion:
DATABASE not open.

Also I check the input file, there is no error of the file, cause if i input these files one by one, there will be no error. It only SOMETIMES happens when the MBC processing several input file.(not always happen).
Attached File  error.JPG ( 341.44K ) Number of downloads: 14


Please Help, this is stange and important for me.

Thank you everyone.

Jim
Go to the top of the page
 
+Quote Post
Rhenus ICT Servi...
post Sep 29 2009, 09:20 AM
Post #2


Regular Contributor
***

Group: Members
Posts: 31
Joined: 6-November 08
Member No.: 82


Hi bluefisher80,

What version of XIB are you using?

On XIB 2.1.1 it is advised to always add "DBID $DBID" to EVERY DATABASE/EXEC SQL statement, e.g:


DATABASE OPEN "db openstring" DBID $DBID;
...
DATABASE EXECUTE "db command" DBID $DBID;
...
DATABASE CLOSE DBID $DBID;

or:

DATABASE OPEN "db openstring" DBID $DBID;
...
EXEC SQL DBID $DBID BEGIN WORK
...
EXEC SQL DBID $DBID INSERT INTO blablabla...
...
EXEC SQL DBID $DBID COMMIT WORK;
...
DATABASE CLOSE DBID $DBID;


I hope this helps.
Go to the top of the page
 
+Quote Post
bluefisher80
post Sep 30 2009, 02:51 PM
Post #3


Visitor
*

Group: Members
Posts: 5
Joined: 23-June 09
Member No.: 576


QUOTE (Rhenus ICT Services @ Sep 29 2009, 09:20 AM) *
Hi bluefisher80,

What version of XIB are you using?

On XIB 2.1.1 it is advised to always add "DBID $DBID" to EVERY DATABASE/EXEC SQL statement, e.g:


DATABASE OPEN "db openstring" DBID $DBID;
...
DATABASE EXECUTE "db command" DBID $DBID;
...
DATABASE CLOSE DBID $DBID;

or:

DATABASE OPEN "db openstring" DBID $DBID;
...
EXEC SQL DBID $DBID BEGIN WORK
...
EXEC SQL DBID $DBID INSERT INTO blablabla...
...
EXEC SQL DBID $DBID COMMIT WORK;
...
DATABASE CLOSE DBID $DBID;


I hope this helps.


Hi, Rhenus ICT Services

Thanks for your advice, i will try them after the vacation. I am using xib2.1.1 sp2, also i will patch sp3 when i get my hands back to my server. I read that the SP3 has 'Some kind of database pool', i think that maybe let me avoid the problem.

Best regards,

Jim
Go to the top of the page
 
+Quote Post
Ben Chua
post May 5 2010, 10:38 PM
Post #4


Visitor
*

Group: Members
Posts: 2
Joined: 6-March 09
Member No.: 379


Hi bluefisher80,

From the description of your problem, i believe the issue is with simultaneous processing of input messages and the MBC written is not catered to run in multisession environment. There are 2 ways to solve this problem:

1. Change the max number of session session of the HMT to 1.

In XIB HMT configuration, there is a setting call max number of session. It is by default 0 (means unlimited session). Changing it to 1 will ensure sequential pickup and execution of messages, hence indirectly resolving the db issue.

2. Change your MBC to cater for multiple session execution environment

Within the MBC, you have to take care not to declare the $DBID variable globally. It should be a local variable within the processmessage statement.
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Skin designed by IPB Forum Skins