When creating an IMM object class with PBE enable, PBE will create a sqlite table, same name as the IMM object class name. Besides, PBE has several internal tables. PBE will be restarted and NEVER come up if user requests to create same class name with one of these reserved ones.
For example: creating a class with following model.
<class name="objects"> <category>SA_CONFIG</category> <rdn> <name>testClass</name> <type>SA_STRING_T</type> <category>SA_CONFIG</category> <flag>SA_INITIALIZED</flag> </rdn> </class>
root@SC-1:~# immcfg -f test.xml FAILED to create class 'objects', rc = SA_AIS_ERR_TIMEOUT (5)
We will observe PBE restarted. Here is the syslog:
2018-01-25 04:11:34.204 SC-1 osafimmpbed: ER SQL statement ('CREATE TABLE "objects" (obj_id integer primary key, "testClass" text, "SaImmAttrImplementerName" text, "SaImmAttrClassName" text, "SaImmAttrAdminOwnerName" text)') failed because:#012 table "objects" already exists
2018-01-25 04:11:34.204 SC-1 osafimmpbed: ER Exiting (line:1447)
I propose to have a check at IMM agent, and return SA_AIS_ERR_INVALID_PARAM to user.
Diff:
https://sourceforge.net/p/opensaf/mailman/message/36204306/
V2 patch
https://sourceforge.net/p/opensaf/mailman/message/36209671/
Update according to Zoran's recommendation. Re-using table name check which exists in ImmModel.
https://sourceforge.net/p/opensaf/mailman/message/36209969/
commit 819a9e4438edfb7fc75a4b06bb7a5aad09891038 (HEAD, origin/develop, ticket-2771, develop)
Author: Vu Minh Nguyen vu.m.nguyen@dektech.com.au
Date: Wed Mar 7 11:34:51 2018 +0700