> On April 27, 2017, 8:25 p.m., Hao Hao wrote: > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.derby.sql > > Lines 30 (patched) > > <https://reviews.apache.org/r/58808/diff/1/?file=1702015#file1702015line30> > > > > Can you explain more about why using 'signleton'and why have '15' > > length restriction here? And add a comment to it. > > kalyan kumar kalvagadda wrote: > Idea is to restrict the the table to have only one record which has the > last notification-id that sentry processed. Applicaiton should do an insert > at the begining and later it should be only updates to existing record. > > To restrict the table to have only one record I have taken below approach > 1. Added RESTRICTION column and made it a primary key > 2. Have set a default value for that column. > 3. JDO definition for this table will not have feild in the class for the > column RESTRICTION, so application will just know NOTIFICATION_ID in the > table. > 4. If application tries to insert another entry into table yy mistake it > will fail.
You mentioned that you had error by definning JDO for this table having no field in the class for the column RESTRICTION. Is that resolved? If not, then this approach does not work. - Na ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58808/#review173252 ----------------------------------------------------------- On May 9, 2017, 11:15 p.m., kalyan kumar kalvagadda wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58808/ > ----------------------------------------------------------- > > (Updated May 9, 2017, 11:15 p.m.) > > > Review request for sentry, Alexander Kolbasov, Hao Hao, Na Li, Sergio Pena, > Vamsee Yarlagadda, and Vadim Spector. > > > Bugs: SENTRY-1726 > https://issues.apache.org/jira/browse/SENTRY-1726 > > > Repository: sentry > > > Description > ------- > > 1. Created new table to store the last notification id > 2. Table will store the notification id's of all the notifications processed > by sentry server. > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.derby.sql > ba70715 > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.mysql.sql > 879e732 > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.oracle.sql > e83ab83 > > sentry-provider/sentry-provider-db/src/main/resources/008-SENTRY-1569.postgres.sql > c28099b > sentry-provider/sentry-provider-db/src/main/resources/sentry-db2-1.8.0.sql > 841dcaa > > sentry-provider/sentry-provider-db/src/main/resources/sentry-derby-1.8.0.sql > 223835e > > sentry-provider/sentry-provider-db/src/main/resources/sentry-mysql-1.8.0.sql > 006d57b > > sentry-provider/sentry-provider-db/src/main/resources/sentry-oracle-1.8.0.sql > 20921ea > > sentry-provider/sentry-provider-db/src/main/resources/sentry-postgres-1.8.0.sql > 489ad66 > > sentry-provider/sentry-provider-db/src/main/resources/sentry-upgrade-db2-1.7.0-to-1.8.0.sql > ec50912 > > > Diff: https://reviews.apache.org/r/58808/diff/2/ > > > Testing > ------- > > Tested with the databases that sentry supports. > > > Thanks, > > kalyan kumar kalvagadda > >