orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.73k stars 869 forks source link

When i set the readonly == true ,i even can't insert data . #9643

Open tonglsh opened 3 years ago

tonglsh commented 3 years ago

OrientDB Version: < 3.2.0 >

OS: < linux >

the ipmiIp is readonly

orientdb {db=cmdb}> info class switch1

CLASS 'switch1'

Records..............: 4
Super classes........: [IVertex]
Default cluster......: switch1 (id=266)
Supported clusters...: switch1(266), switch1_1(267), switch1_2(268), switch1_3(269), switch1_4(270), switch1_5(271), switch1_6(272), switch1_7(273), switch1_8(274), switch1_9(275), switch1_10(276), switch1_11(277), switch1_12(278), switch1_13(279), switch1_14(280), switch1_15(281)
Cluster selection....: round-robin
Oversize.............: 0.0

PROPERTIES
+----+-----------------+------+-----------------+---------+--------+--------+----+----+-------+-------+
|#   |NAME             |TYPE  |LINKED-TYPE/CLASS|MANDATORY|READONLY|NOT-NULL|MIN |MAX |COLLATE|DEFAULT|
+----+-----------------+------+-----------------+---------+--------+--------+----+----+-------+-------+
|0   |ipmiIp           |STRING|                 |true     |true    |false   |    |    |default|       |
|1   |ipmiCiphersuiteid|STRING|                 |false    |false   |false   |    |    |default|       |
|2   |ipmiPassword     |STRING|                 |false    |false   |false   |    |    |default|       |
|3   |ipmiUsername     |STRING|                 |false    |false   |false   |    |    |default|       |
|4   |ipmiVersion      |STRING|                 |false    |false   |false   |    |    |default|       |
|5   |ipmiRetries      |STRING|                 |false    |false   |false   |    |    |default|1      |
|6   |ipmiEnable       |STRING|                 |false    |false   |false   |    |    |default|1      |
+----+-----------------+------+-----------------+---------+--------+--------+----+----+-------+-------+

CUSTOM ATTRIBUTES
+----+----------------+--------------+
|#   |NAME            |VALUE         |
+----+----------------+--------------+
|0   |menuEnabled     |true          |
|1   |name            |switch1_1h    |
|2   |icon            |icon-tubiao-11|
|3   |monitorProtocols|ipmi          |
|4   |group           |CSSC          |
+----+----------------+--------------+
orientdb {db=cmdb}> insert into switch1 (ipmiIp )  values  ( '1.2.3.4' ) 

Error: com.orientechnologies.orient.core.exception.OValidationException: The field 'switch1.ipmiIp' is immutable and cannot be altered. Field value is: 1.2.3.4
        DB name="cmdb"
        Error Code="4"
        DB name="cmdb"
        Error Code="4"

orientdb {db=cmdb}>

when i set readonly == false ,it can be inseert.

luigidellaquila commented 3 years ago

Hi @tonglsh

I tested it with a simple script: I created a class with a read-only attributed and tried to do an insert, but everything seems to work fine. Can you please help me to reproduce it? Maybe you can provide a SQL script that shows the problem?

Thanks

Luigi