| 30 | |
| 31 | {{{ |
| 32 | featureService.ExecuteSqlQuery(featureSourceId, "SAVEPOINT X", null, null); |
| 33 | try |
| 34 | { |
| 35 | MgSqlDataReader reader1 = featureService.ExecuteSqlQuery(featureSourceId, "SELECT FID FROM DUMMY", null, null); |
| 36 | featureService..ExecuteSqlNonQuery(featureSourceId, "SAVEPOINT Y", null, null); |
| 37 | try |
| 38 | { |
| 39 | featureService.ExecuteSqlNonQuery(featureSourceId, "INSERT INTO TEST2 (FID) VALUES (1)", null, null); |
| 40 | } |
| 41 | catch (System.Exception) |
| 42 | { |
| 43 | featureService.ExecuteSqlQuery(featureSourceId, "ROLLBACK TO Y", null, null); |
| 44 | } |
| 45 | |
| 46 | while (reader1.ReadNext()) |
| 47 | { |
| 48 | MgParameterCollection parameters = new MgParameterCollection(); |
| 49 | MgInt32Property inFid = new MgInt32Property("myInput", r1.GetInt32("FID")); |
| 50 | MgParameter inParameter = new MgParameter(inFid, MgParameterDirection.Input); |
| 51 | parameters.Add(inParameter); |
| 52 | featureService.ExecuteSqlNonQuery(featureSourceId, "INSERT INTO TEST(FID) VALUES(:myInput)", parameters, null); |
| 53 | } |
| 54 | r1.Close(); |
| 55 | r1.Dispose(); |
| 56 | } |
| 57 | catch (System.Exception) |
| 58 | { |
| 59 | featureService.ExecuteSqlQuery(featureSourceId, "ROLLBACK TO X", null, null); |
| 60 | } |
| 61 | featureService.ExecuteSqlQuery(featureSourceId, "COMMIT", null, null); |
| 62 | }}} |