So here is couple cases. I've got spatial table in SQL Server 2017. I created connection, namedtable (editable), namedlayer and namedmap. finally I added map to my mapconfig.
CASE1: Editing object in SSA
- When i tried to edit object in SSA and save the changes I've got an error: 500 Internal Server Error. In browser developers tools in tab "network" -> "Preview" there is a message: type: "com.mapinfo.midev.service.feature.ws.v1.ServiceException",…} message:"Attempt to update readonly column MI_PRINX." type: "com.mapinfo.midev.service.feature.ws.v1.ServiceException"
- So I go to SQL Server Management Studio and make changes for column "MI_PRINX": Design table -> column "MI_PRINX" -> Identity Specification = No
- After that I can edit and save the changes.
CASE2: Adding new objects in SSA
- After CASE1 I tried to add new object and save it in my table in SQL Server. So I created geometry and didn't fill any attributes. Then a saved my changes.
- Using browser developers tools in tab "Network" -> "Headers" I can see my postData: geometry, attributes (nulls) AND MI_PRINX: 9999999
- Using the same developers tools in tab "Network" -> "Preview" I see that the value of MI_PRINX is differnet than in "Headers": -27009. And that value (-27009) I've got in my DB Table!
PURPOSE: it looks like that somewhere there is convertation going from 4 byte int nj 2 byte int and '999999' converts to '-27009'. I guess it is bug
4. Then I created another one object and tried to save it in the same DB Table.
5. I've got Error: 400 Bad Request in tab "Headers". Also I can see my postData: geometry, attributes (nulls) AND MI_PRINX: 9999999 !!!
6. In tab "Preview" or "Response" I have message: "com.mapinfo.midev.dp.jdbc.JDBCDataProviderRuntimeException: Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object 'dbo.My_Table' The duplicate key value is (-27009).
Also, when I see tabular results for my table in SSA I can't see MI_PRINX. BUT when I do editing or adding new record that field is available for manual inserting and editing. It is kind of weird - MI_PRINX is a Primary Key and I don't think it it good way to allow users make such changes.
I hope you can help me to solve my problems with adding records in DB Table and tell me what I am doing wrong.
Thank you.