I have a simple table with its datasource, say having fields id, field1, field2, and field3.
I got an insert request from the client. I want that no duplicates are inserted to the table regarding field1 and field2 only (so id and field3 are ignored).
What approach would you recommend ?
I got three ideas:
1) Intercept the insert dsRequest in a DMI method, check for duplicates, and return an error status if the row already exists.
2) Have a server-side validation in the datasource.ds.xml. Is this type of validation possible/feasible in this scenario?
3) Have the DB guard or something similar, i.e. validation to the DB- level.
I tend to prefer 1), since it is simple. But I would also like 2) if it is possible to do. If yes, what type of validation should the field/s have?
Using Smartgwt 4.1 p.
I got an insert request from the client. I want that no duplicates are inserted to the table regarding field1 and field2 only (so id and field3 are ignored).
What approach would you recommend ?
I got three ideas:
1) Intercept the insert dsRequest in a DMI method, check for duplicates, and return an error status if the row already exists.
2) Have a server-side validation in the datasource.ds.xml. Is this type of validation possible/feasible in this scenario?
3) Have the DB guard or something similar, i.e. validation to the DB- level.
I tend to prefer 1), since it is simple. But I would also like 2) if it is possible to do. If yes, what type of validation should the field/s have?
Using Smartgwt 4.1 p.
Comment