on 10-18-2005 10:39 AM
I have two addons which may create database tables / user defined fields if don't exist. Now my experience is (at least it appears so) that SAP B1 starts two add-ons at the same time? This could mean that the two add-ons could create database fields concurrently, so they may conflict if they access the same tables (I got an error message if both add-ons create tables or fields)..
Am I right with this? If Yes, how can i avoid this (so that SAP B1 waits with the second addon until the first addon has completely started up)
Regards,
I have multible addon running at the same time, and there are no problems. just remeber that each til you use the Metadata use the garbage collector in the programming language to clear variables (item = null, GC.Collect())
public static void Add(string TableName, string TableDescription, BoUTBTableType TableType, ref bool NewTables) {
if(!SBO.DI.Metadata.UserDefinedTables.ExistTable(TableName)) {
if(TableName.Length > 19) {
throw new Exception(SBO.Texts.UserdefinedTables.addUserTable_Template_ForLangtTabelNavn.Replace("%1",TableName));
}
UserTablesMD tb_md = (UserTablesMD) SBO.DI.Connection.SboCompany.GetBusinessObject(BoObjectTypes.oUserTables);
tb_md.TableName = TableName;
tb_md.TableDescription = TableDescription;
tb_md.TableType = TableType;
if(tb_md.Add() != 0) {
tb_md=null;
GC.Collect();
throw new Exception(SBO.Texts.UserdefinedTables.addUserTable_Template_Fejl.Replace("%1",TableName).Replace("%2",GetLastError.ErrorDescription));
}
else {
tb_md=null;
GC.Collect();
NewTables = true;
}
}
else {
if (NewTables) {
NewTables = true;
}
else {
NewTables = false;
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
This is the documentation of the UserTablesMD object.
DI API allows only one meta data object instance (with no other instances of any object type). This maintains data integrity by preventing any manipulation of a business object while modifying the object's properties.
You could insert a random timer in each add-on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.