Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
APPID Database tips Contents Description .................................................................................................................................................... 1 Source Table missing records ....................................................................................................................... 1 Example ................................................................................................................................................. 1 Fixing this error ..................................................................................................................................... 2 Error resulting from missing source table records ............................................................................... 2 Force Tag Types............................................................................................................................................. 2 Errors that possibly indicate that a TAG_TYPE needs to be forced ...................................................... 3 Sync errors Field Mismatch ........................................................................................................................... 3 Components not converted .......................................................................................................................... 4 Description Certain database errors are caused by pre-existing database conditions. Others are caused by OPPID relationship errors. See APPID Conversion DOC_REG Precautions. This wiki can be a resource for debugging these issues. See the wiki url for setting SQL logging. Source Table missing records It is observed if there are records in the TAG_REG table but missing from the source table, a sync error will occur. This error occurred when Valve records were present in the TAG_REG table but the VALVE table records were missing. Example The record with keytag 0000000608 exists in the TAG_REG table. TAG_REG KEYTAG TAG_TYPE TAG_CODE TAG_NO TAG_NOA KEYTAG_GUID_PK 0000000608 AT_HVALVE C-N V-H-1 {B3E50296-7943-40CB-96ED-3D8F547C4017} The VALVE is empty or is missing the matching 0000000608 keytag VALVE VALVE KEYTAG VTYP VNUM 0000000609 H 2 Fixing this error Add the 0000000608 keytag to the VALVE table VALVE KEYTAG VTYP VNUM 0000000608 H 1 0000000609 H 2 Error resulting from missing source table records 02-28-12 12:30:38 ERROR - Bentley.Plant.ModelingFramework - Failed to execute commit statement 'INSERT INTO [TAG_REG] ( [TAG_NO] , [CREATE_TM] , [KEYTAG_GUID_PK] , [KEYTAG] , [TAG_TYPE] ) VALUES ( ? , ? , ? , ? , ? ) ' for an instance of class VALVE because of an exception of the type OleDbException with the message 'The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.' 02-28-12 12:30:38 ERROR - Bentley.Plant.ModelingFramework - New records being synchronized have been rolled back. Once the errors have been fixed, synchronization can be performed again. 02-28-12 12:30:38 DEBUG - Bentley.EC.SQLAdapter - Executing Sql statement: DELETE FROM [TAG_REG] WHERE [KEYTAG] = '0000000633' AND ( [TAG_REG].[TAG_TYPE] = 'AT_HVALVE' ) 02-28-12 12:30:38 ERROR - Bentley.Plant.ModelingFramework.SQLPluginAdapter - *Synchronization stopped because of error 'Failed to execute commit statement 'INSERT INTO [TAG_REG] ( [TAG_NO] , [CREATE_TM] , [KEYTAG_GUID_PK] , [KEYTAG] , [TAG_TYPE] ) VALUES ( ? , ? , ? , ? , ? ) ' for an instance of class VALVE because of an exception of the type OleDbException with the message 'The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Force Tag Types There are several classes that require the conversion to force a tag type change. This is needed to have correct database syncing. For further info see the following document: APPID Conversion AT_EQTWR Tower Limitation.docx. The Force_TagType custom attribute is applied to several types: APPID Component AT_EQTWR EXCH_FUR EXCH_REB SPHERE TNK_HS TNK_ST VPMP CCMP Forced TAG_TYPE AT_EQVES AT_EQUIP AT_EQUIP AT_EQTNK AT_EQTNK AT_EQTNK AT_EQUIP AT_EQUIP Descirption Equipment Tower Furnace Reboiler Sphere Heat Stirred Tank Stirred Tank Vacuum Pump Centrifugal Blower CBLW AT_EQUIP Centrifugal Blower Errors that possibly indicate that a TAG_TYPE needs to be forced The message statement creating duplicate values could indicate that a TAG_TYPE does not match an ECClass. Turn on the sql debugger, find the error in the log file: ERROR - Bentley.EC.SQLAdapter. Right above the error was the SQL statement that failed. Use these values (KEYTAG, TAG_NO) to examine the database and diagnose the error. 03-22-12 15:16:36 DEBUG - Bentley.EC.SQLAdapter - Executing Sql statement: INSERT INTO [TAG_REG] ( [CREATE_TM] , [KEYTAG_GUID_PK] , [TAG_NO] , [KEYTAG] , [TAG_TYPE] ) VALUES ( NULL , '{B47F1F74-A81D-4540-B500-C5E66424D29A}' , 'VESSEL-E6' , '0000000612' , 'AT_EQTNK' ) 03-22-12 15:16:36 ERROR - Bentley.EC.SQLAdapter - Statement -=(INSERT INTO [TAG_REG] ( [CREATE_TM] , [KEYTAG_GUID_PK] , [TAG_NO] , [KEYTAG] , [TAG_TYPE] ) VALUES ( ? , ? , ? , ? , ? ) )=- has failed: The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again. Sync errors Field Mismatch These errors can occur when the database column has value type that does not match OPPID a value type: DB Column type = STRING : ECProperty type = DOUBLE. OPPID tries to convert the value in the database to match schema mapping. o If the value in a database string column is 100 and that column is mapped to an OPPID property that is defined as a double, the value 100 is accepted. o If that database value is 100 lbf, an error will occur. An example of this would be if PIPERUN.POPP has a value of 100lbf. PIPE_RUN POPP 100 lbf OPPID would have a message center error possibly like: 3-21-12 17:08:09 LOG_ERROR - Bentley.Plant.ModelingFramework.SQLPluginAdapter - *Synchronization stopped because of error 'Failed to execute commit statement 'INSERT INTO [PIPE_RUN] ( [DESIGNTEMPF] , [PSZ] , [KEYTAG_GUID_PK] , [PRESS_MAX] , [INSMATL] , [NOM_DIAMETER] , [POPT] , [CRITICAL_PRESS] , [DESIGNPRESSPSIG] , [INSTHKNS] , [PSPEC] , [RUN_NAME] , [TRACERTEMP] , [TEMP_MIN] , [PCLASS] , [PFLOW] , [POPP] , [KEYTAG] ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ' for an instance of class PIPING_NETWORK_SEGMENT because of an exception of the type OleDbException with the message 'The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.''* Input string was not in a correct format. To fix this error remove the lbf from the PIPE_RUN.POPP field PIPE_RUN POPP 100 The Database column types for most tables are defined as strings. This includes pressure and temperature columns. OPPID defines the types as doubles. As shown with the example above PIPE_RUN.POPP is defined as string type where as NORMAL_OPERATING_PRESSURE is defined as a double. Mapping in PlantProjectSchema.01.03_Autoplant_PIW.01.03.mapping.xml <Property name="NORMAL_OPERATING_PRESSURE" state="Active"> <Column name="PIPE_RUN.POPP" /> </Property> Components not converted From time to time some components do not get converted. There are several reasons for this: Missing mapping APPID inserted blocks with no xdata Corrupt xdata on a APPID component If an APPID component has corrupt xdata, the component will not be converted or deleted. If the APPID block is detected but no xdata resides on the element, the component will not be converted or deleted. All of these anomalies will be logged. In the case of inserted blocks with no xdata, the block name (32500) and its element ID (635) will be logged.