Skip to Content
author's profile photo Former Member
Former Member

SAP B1 2004 starts 2 addons at the same time?

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,

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 10:36 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 18, 2005 at 11:55 AM

    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;
    				}
    			}
    		}
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.