Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Move the rawData parameter checking code into its own (static) method. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | sessions |
Files: | files | file ages | folders |
SHA1: |
0adbed8ca0c39b6b6ec313edd3d74323 |
User & Date: | mistachkin 2017-10-10 23:02:37.960 |
Context
2017-10-11
| ||
00:32 | More work on tests. check-in: e9782935e2 user: mistachkin tags: sessions | |
2017-10-10
| ||
23:02 | Move the rawData parameter checking code into its own (static) method. check-in: 0adbed8ca0 user: mistachkin tags: sessions | |
22:42 | Add tests for the enabled/disabled state of the session object. check-in: 7ee168e2ff user: mistachkin tags: sessions | |
Changes
Changes to System.Data.SQLite/SQLiteSession.cs.
︙ | ︙ | |||
143 144 145 146 147 148 149 150 151 152 153 154 155 156 | string tableName ); } #endregion /////////////////////////////////////////////////////////////////////////// #region SQLiteConnectionLock Class internal abstract class SQLiteConnectionLock : IDisposable { #region Private Constants private const string LockNopSql = "SELECT 1;"; /////////////////////////////////////////////////////////////////////// | > > > > > > > > > > > > > > > > > > > > > > > | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | string tableName ); } #endregion /////////////////////////////////////////////////////////////////////////// #region SQLiteSessionHelpers Class internal static class SQLiteSessionHelpers { #region Public Methods public static void CheckRawData( byte[] rawData ) { if (rawData == null) throw new ArgumentNullException("rawData"); if (rawData.Length == 0) { throw new ArgumentException( "empty change set data", "rawData"); } } #endregion } #endregion /////////////////////////////////////////////////////////////////////////// #region SQLiteConnectionLock Class internal abstract class SQLiteConnectionLock : IDisposable { #region Private Constants private const string LockNopSql = "SELECT 1;"; /////////////////////////////////////////////////////////////////////// |
︙ | ︙ | |||
547 548 549 550 551 552 553 | /////////////////////////////////////////////////////////////////////// #region Static "Factory" Methods public static SQLiteMemoryChangeSetIterator Create( byte[] rawData ) { | < < | < < | 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 | /////////////////////////////////////////////////////////////////////// #region Static "Factory" Methods public static SQLiteMemoryChangeSetIterator Create( byte[] rawData ) { SQLiteSessionHelpers.CheckRawData(rawData); SQLiteMemoryChangeSetIterator result = null; IntPtr pData = IntPtr.Zero; IntPtr iterator = IntPtr.Zero; try { |
︙ | ︙ | |||
1025 1026 1027 1028 1029 1030 1031 | public void AddChangeSet( byte[] rawData ) { CheckDisposed(); CheckHandle(); | < < | < < | 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | public void AddChangeSet( byte[] rawData ) { CheckDisposed(); CheckHandle(); SQLiteSessionHelpers.CheckRawData(rawData); IntPtr pData = IntPtr.Zero; try { int nData = 0; |
︙ | ︙ | |||
1084 1085 1086 1087 1088 1089 1090 | public void CreateChangeSet( ref byte[] rawData ) { CheckDisposed(); CheckHandle(); | < < | < < | 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | public void CreateChangeSet( ref byte[] rawData ) { CheckDisposed(); CheckHandle(); SQLiteSessionHelpers.CheckRawData(rawData); IntPtr pData = IntPtr.Zero; try { int nData = 0; |
︙ | ︙ | |||
1796 1797 1798 1799 1800 1801 1802 | { this.rawData = rawData; } #endregion /////////////////////////////////////////////////////////////////////// | < < < < < < < < < < < < < > | | 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 | { this.rawData = rawData; } #endregion /////////////////////////////////////////////////////////////////////// #region ISQLiteChangeSet Members public ISQLiteChangeSet Invert() { CheckDisposed(); SQLiteSessionHelpers.CheckRawData(rawData); IntPtr pInData = IntPtr.Zero; IntPtr pOutData = IntPtr.Zero; try { int nInData = 0; |
︙ | ︙ | |||
1860 1861 1862 1863 1864 1865 1866 | /////////////////////////////////////////////////////////////////////// public ISQLiteChangeSet CombineWith( ISQLiteChangeSet changeSet ) { CheckDisposed(); | > | | | 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 | /////////////////////////////////////////////////////////////////////// public ISQLiteChangeSet CombineWith( ISQLiteChangeSet changeSet ) { CheckDisposed(); SQLiteSessionHelpers.CheckRawData(rawData); SQLiteMemoryChangeSet memoryChangeSet = changeSet as SQLiteMemoryChangeSet; if (memoryChangeSet == null) { throw new ArgumentException( "not a memory based change set", "changeSet"); } SQLiteSessionHelpers.CheckRawData(memoryChangeSet.rawData); IntPtr pInData1 = IntPtr.Zero; IntPtr pInData2 = IntPtr.Zero; IntPtr pOutData = IntPtr.Zero; try { |
︙ | ︙ | |||
1945 1946 1947 1948 1949 1950 1951 | public void Apply( SessionConflictCallback conflictCallback, SessionTableFilterCallback tableFilterCallback, object clientData ) { CheckDisposed(); | > | | 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 | public void Apply( SessionConflictCallback conflictCallback, SessionTableFilterCallback tableFilterCallback, object clientData ) { CheckDisposed(); SQLiteSessionHelpers.CheckRawData(rawData); if (conflictCallback == null) throw new ArgumentNullException("conflictCallback"); UnsafeNativeMethods.xSessionFilter xFilter = GetDelegate( tableFilterCallback, clientData); |
︙ | ︙ |