1 21 22 package org.apache.derby.impl.sql.execute; 23 24 import org.apache.derby.iapi.services.loader.GeneratedMethod; 25 import org.apache.derby.iapi.services.monitor.Monitor; 26 import org.apache.derby.iapi.services.sanity.SanityManager; 27 import org.apache.derby.iapi.services.stream.HeaderPrintWriter; 28 import org.apache.derby.iapi.services.stream.InfoStreams; 29 import org.apache.derby.iapi.services.io.StreamStorable; 30 import org.apache.derby.iapi.error.StandardException; 31 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; 32 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor; 33 import org.apache.derby.iapi.sql.dictionary.DataDictionary; 34 import org.apache.derby.iapi.sql.dictionary.DataDictionaryContext; 35 import org.apache.derby.iapi.sql.dictionary.TableDescriptor; 36 import org.apache.derby.iapi.types.BooleanDataValue; 37 import org.apache.derby.iapi.types.DataValueDescriptor; 38 import org.apache.derby.iapi.types.RowLocation; 39 import org.apache.derby.iapi.sql.execute.ConstantAction; 40 import org.apache.derby.iapi.sql.execute.CursorResultSet; 41 import org.apache.derby.iapi.sql.execute.ExecRow; 42 import org.apache.derby.iapi.sql.execute.ExecutionContext; 43 import org.apache.derby.iapi.sql.execute.RowChanger; 44 import org.apache.derby.iapi.sql.execute.NoPutResultSet; 45 46 import org.apache.derby.iapi.types.DataValueDescriptor; 47 import org.apache.derby.iapi.sql.Activation; 48 import org.apache.derby.iapi.sql.ResultDescription; 49 import org.apache.derby.iapi.sql.ResultSet; 50 51 import org.apache.derby.iapi.store.access.ConglomerateController; 52 import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo; 53 import org.apache.derby.iapi.store.access.ScanController; 54 import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo; 55 import org.apache.derby.iapi.store.access.TransactionController; 56 57 import org.apache.derby.iapi.reference.SQLState; 58 59 import org.apache.derby.iapi.db.TriggerExecutionContext; 60 import org.apache.derby.iapi.services.io.FormatableBitSet; 61 import java.util.Properties ; 62 import java.util.Hashtable ; 63 64 72 class UpdateResultSet extends DMLWriteResultSet 73 { 74 private TransactionController tc; 75 private ExecRow newBaseRow; 76 private ExecRow row; 77 private ExecRow deferredSparseRow; 78 UpdateConstantAction constants; 79 80 private ResultDescription resultDescription; 81 private NoPutResultSet source; 82 NoPutResultSet savedSource; 83 private RowChanger rowChanger; 84 85 protected ConglomerateController deferredBaseCC; 86 87 protected long[] deferredUniqueCIDs; 88 protected boolean[] deferredUniqueCreated; 89 protected ConglomerateController deferredUniqueCC[]; 90 protected ScanController[] deferredUniqueScans; 91 92 private TemporaryRowHolderImpl deletedRowHolder; 93 private TemporaryRowHolderImpl insertedRowHolder; 94 95 private RISetChecker riChecker; 97 private TriggerInfo triggerInfo; 98 private TriggerEventActivator triggerActivator; 99 private boolean updatingReferencedKey; 100 private boolean updatingForeignKey; 101 private int numOpens; 102 private long heapConglom; 103 private FKInfo[] fkInfoArray; 104 private FormatableBitSet baseRowReadList; 105 private GeneratedMethod checkGM; 106 private int resultWidth; 107 private int numberOfBaseColumns; 108 private ExecRow deferredTempRow; 109 private ExecRow deferredBaseRow; 110 private ExecRow oldDeletedRow; 111 private ResultDescription triggerResultDescription; 112 113 int lockMode; 114 boolean deferred; 115 boolean beforeUpdateCopyRequired = false; 116 117 121 public ResultDescription getResultDescription() 122 { 123 return resultDescription; 124 } 125 126 130 135 UpdateResultSet(NoPutResultSet source, 136 GeneratedMethod checkGM, 137 Activation activation) 138 throws StandardException 139 { 140 this(source, checkGM , activation, activation.getConstantAction(),null); 141 } 142 143 147 155 UpdateResultSet(NoPutResultSet source, 156 GeneratedMethod checkGM, 157 Activation activation, 158 int constantActionItem, 159 int rsdItem) 160 throws StandardException 161 { 162 this(source, checkGM , activation, 163 ((ConstantAction)activation.getPreparedStatement().getSavedObject(constantActionItem)), 164 (ResultDescription) activation.getPreparedStatement().getSavedObject(rsdItem)); 165 166 deferred = true; 168 } 169 170 171 175 180 UpdateResultSet(NoPutResultSet source, 181 GeneratedMethod checkGM, 182 Activation activation, 183 ConstantAction passedInConstantAction, 184 ResultDescription passedInRsd) 185 throws StandardException 186 { 187 super(activation, passedInConstantAction); 188 189 tc = activation.getTransactionController(); 191 this.source = source; 192 this.checkGM = checkGM; 193 194 constants = (UpdateConstantAction) constantAction; 195 fkInfoArray = constants.getFKInfo( lcc.getExecutionContext() ); 196 triggerInfo = constants.getTriggerInfo(lcc.getExecutionContext()); 197 198 heapConglom = constants.conglomId; 199 200 baseRowReadList = constants.getBaseRowReadList(); 201 if(passedInRsd ==null) 202 resultDescription = source.getResultDescription(); 203 else 204 resultDescription = passedInRsd; 205 212 if (SanityManager.DEBUG) 213 { 214 if (resultDescription == null) 215 { 216 SanityManager.ASSERT(triggerInfo == null, "triggers need a result description to pass to result sets given to users"); 217 } 218 } 219 220 if (fkInfoArray != null) 221 { 222 for (int i = 0; i < fkInfoArray.length; i++) 223 { 224 if (fkInfoArray[i].type == FKInfo.REFERENCED_KEY) 225 { 226 updatingReferencedKey = true; 227 if (SanityManager.DEBUG) 228 { 229 SanityManager.ASSERT(constants.deferred, "updating referenced key but update not deferred, wuzzup?"); 230 } 231 } 232 else 233 { 234 updatingForeignKey = true; 235 } 236 } 237 } 238 239 240 resultWidth = resultDescription.getColumnCount(); 241 242 248 numberOfBaseColumns = (resultWidth - 1) / 2; 249 250 251 newBaseRow = RowUtil.getEmptyValueRow(numberOfBaseColumns, lcc); 252 253 254 lockMode = decodeLockMode(lcc, constants.lockMode); 255 deferred = constants.deferred; 256 257 if(triggerInfo != null || fkInfoArray !=null){ 262 beforeUpdateCopyRequired = true; 263 } 264 265 } 266 269 public void open() throws StandardException 270 { 271 272 setup(); 273 collectAffectedRows(); 274 275 280 if (deferred) 281 { 282 283 runChecker(true); fireBeforeTriggers(); 285 updateDeferredRows(); 286 287 rowChanger.finish(); 288 runChecker(false); fireAfterTriggers(); 290 291 } 292 else{ 293 294 rowChanger.finish(); 295 } 296 297 cleanUp(); 298 } 299 300 301 304 void setup() throws StandardException 305 { 306 boolean firstOpen = (rowChanger == null); 307 308 rowCount = 0; 309 310 311 if (lcc.getRunTimeStatisticsMode()) 312 { 313 314 savedSource = source; 315 } 316 317 322 if (firstOpen) 323 { 324 rowChanger = lcc.getLanguageConnectionFactory().getExecutionFactory() 325 .getRowChanger( heapConglom, 326 constants.heapSCOCI, 327 heapDCOCI, 328 constants.irgs, 329 constants.indexCIDS, 330 constants.indexSCOCIs, 331 indexDCOCIs, 332 constants.numColumns, 333 tc, 334 constants.changedColumnIds, 335 constants.getBaseRowReadList(), 336 constants.getBaseRowReadMap(), 337 constants.getStreamStorableHeapColIds(), 338 activation); 339 rowChanger.setIndexNames(constants.indexNames); 340 } 341 else 342 { 343 lcc.getStatementContext().setTopResultSet(this, subqueryTrackingArray); 344 } 345 346 347 351 rowChanger.open(lockMode); 352 353 if (numOpens++ == 0) 354 { 355 source.openCore(); 356 } 357 else 358 { 359 source.reopenCore(); 360 } 361 362 368 if (deferred) 369 { 370 activation.clearIndexScanInfo(); 371 } 372 373 if (fkInfoArray != null) 374 { 375 if (riChecker == null) 376 { 377 riChecker = new RISetChecker(tc, fkInfoArray); 378 } 379 else 380 { 381 riChecker.reopen(); 382 } 383 } 384 385 if (deferred) 386 { 387 390 if (firstOpen) 391 { 392 deferredTempRow = RowUtil.getEmptyValueRow(numberOfBaseColumns+1, lcc); 393 oldDeletedRow = RowUtil.getEmptyValueRow(numberOfBaseColumns, lcc); 394 triggerResultDescription = (resultDescription != null) ? 395 resultDescription.truncateColumns(numberOfBaseColumns+1) : 396 null; 397 } 398 399 Properties properties = new Properties (); 400 401 rowChanger.getHeapConglomerateController().getInternalTablePropertySet(properties); 403 if(beforeUpdateCopyRequired){ 404 deletedRowHolder = 405 new TemporaryRowHolderImpl(activation, properties, 406 triggerResultDescription); 407 } 408 insertedRowHolder = 409 new TemporaryRowHolderImpl(activation, properties, 410 triggerResultDescription); 411 412 rowChanger.setRowHolder(insertedRowHolder); 413 } 414 415 } 416 417 422 private FormatableBitSet checkStreamCols() 423 { 424 DataValueDescriptor[] cols = row.getRowArray(); 425 FormatableBitSet streamCols = null; 426 for (int i = 0; i < numberOfBaseColumns; i++) 427 { 428 if (cols[i+numberOfBaseColumns] instanceof StreamStorable) { 430 if (streamCols == null) streamCols = new FormatableBitSet(numberOfBaseColumns); 431 streamCols.set(i); 432 } 433 } 434 return streamCols; 435 } 436 437 private void objectifyStream(ExecRow tempRow, FormatableBitSet streamCols) throws StandardException 438 { 439 DataValueDescriptor[] cols = tempRow.getRowArray(); 440 for (int i = 0; i < numberOfBaseColumns; i++) 441 { 442 if (cols[i] != null && streamCols.get(i)) 443 ((StreamStorable)cols[i]).loadStream(); 444 } 445 } 446 447 public boolean collectAffectedRows() throws StandardException 448 { 449 450 boolean rowsFound = false; 451 row = getNextRowCore(source); 452 if (row!=null) 453 rowsFound = true; 454 else 455 { 456 activation.addWarning( 457 StandardException.newWarning( 458 SQLState.LANG_NO_ROW_FOUND)); 459 } 460 461 TableScanResultSet tableScan = (TableScanResultSet) activation.getForUpdateIndexScan(); 463 boolean notifyCursor = ((tableScan != null) && ! tableScan.sourceDrained); 464 boolean checkStream = (deferred && rowsFound && ! constants.singleRowSource); 465 FormatableBitSet streamCols = (checkStream ? checkStreamCols() : null); 466 checkStream = (streamCols != null); 467 468 while ( row != null ) 469 { 470 471 475 476 482 if (deferred) 483 { 484 492 if (triggerInfo == null) 493 { 494 evaluateCheckConstraints( checkGM, activation ); 495 } 496 497 502 RowUtil.copyRefColumns(deferredTempRow, 503 row, 504 numberOfBaseColumns, 505 numberOfBaseColumns + 1); 506 if (checkStream) 507 objectifyStream(deferredTempRow, streamCols); 508 509 insertedRowHolder.insert(deferredTempRow); 510 511 515 if(beforeUpdateCopyRequired) 516 { 517 RowUtil.copyRefColumns(oldDeletedRow, 518 row, 519 numberOfBaseColumns); 520 521 deletedRowHolder.insert(oldDeletedRow); 522 } 523 524 534 if (deferredBaseRow == null) 535 { 536 deferredBaseRow = RowUtil.getEmptyValueRow(numberOfBaseColumns, lcc); 537 538 RowUtil.copyCloneColumns(deferredBaseRow, row, 539 numberOfBaseColumns); 540 541 545 deferredSparseRow = makeDeferredSparseRow(deferredBaseRow, 546 baseRowReadList, 547 lcc); 548 } 549 } 550 else 551 { 552 evaluateCheckConstraints( checkGM, activation ); 553 554 557 RowLocation baseRowLocation = (RowLocation) 558 (row.getColumn(resultWidth)).getObject(); 559 560 RowUtil.copyRefColumns(newBaseRow, 561 row, 562 numberOfBaseColumns, 563 numberOfBaseColumns); 564 565 if (riChecker != null) 566 { 567 575 riChecker.doFKCheck(newBaseRow); 576 } 577 578 source.updateRow(newBaseRow); 579 rowChanger.updateRow(row,newBaseRow,baseRowLocation); 580 581 if (notifyCursor) 583 notifyForUpdateCursor(row.getRowArray(),newBaseRow.getRowArray(),baseRowLocation, 584 tableScan); 585 } 586 587 rowCount++; 588 589 if (constants.singleRowSource) 591 { 592 row = null; 593 } 594 else 595 { 596 row = getNextRowCore(source); 597 } 598 } 599 600 return rowsFound; 601 } 602 603 613 private void notifyForUpdateCursor(DataValueDescriptor[] row, DataValueDescriptor[] newBaseRow, 614 RowLocation rl, TableScanResultSet tableScan) 615 throws StandardException 616 { 617 int[] indexCols = tableScan.indexCols; 618 int[] changedCols = constants.changedColumnIds; 619 boolean placedForward = false, ascending, decided = false, overlap = false; 620 int basePos, k; 621 625 for (int i = 0; i < indexCols.length; i++) 626 { 627 basePos = indexCols[i]; 628 if (basePos > 0) 629 ascending = true; 630 else 631 { 632 ascending = false; 633 basePos = -basePos; 634 } 635 for (int j = 0; j < changedCols.length; j++) 636 { 637 if (basePos == changedCols[j]) 638 { 639 decided = true; 645 int[] map = constants.getBaseRowReadMap(); 646 if (map == null) 647 k = basePos - 1; 648 else 649 k = map[basePos - 1]; 650 651 DataValueDescriptor key; 652 657 if (tableScan.compareToLastKey) 658 key = tableScan.lastCursorKey.getColumn(i + 1); 659 else 660 key = row[k]; 661 662 666 if ((ascending && key.greaterThan(newBaseRow[k], key).equals(true)) || 667 (!ascending && key.lessThan(newBaseRow[k], key).equals(true))) 668 placedForward = true; 669 else if (key.equals(newBaseRow[k], key).equals(true)) 670 { 671 decided = false; 672 overlap = true; 673 } 674 break; 675 } 676 } 677 if (decided) break; 679 } 680 684 if (overlap && !decided) 685 placedForward = true; 686 687 if (placedForward) { 689 696 int maxCapacity = lcc.getOptimizerFactory().getMaxMemoryPerTable() / 16; 697 if (maxCapacity < 100) 698 maxCapacity = 100; 699 700 if (tableScan.past2FutureTbl == null) 701 { 702 double rowCount = tableScan.getEstimatedRowCount(); 703 int initCapacity = 32 * 1024; 704 if (rowCount > 0.0) 705 { 706 rowCount = rowCount / 0.75 + 1.0; if (rowCount < initCapacity) 708 initCapacity = (int) rowCount; 709 } 710 if (maxCapacity < initCapacity) 711 initCapacity = maxCapacity; 712 713 tableScan.past2FutureTbl = new Hashtable (initCapacity); 714 } 715 716 Hashtable past2FutureTbl = tableScan.past2FutureTbl; 717 724 RowLocation updatedRL = (RowLocation) rl.getClone(); 725 726 if (past2FutureTbl.size() < maxCapacity) 727 past2FutureTbl.put(updatedRL, updatedRL); 728 else 729 { 730 tableScan.skipFutureRowHolder = true; 731 ExecRow rlRow = new ValueRow(1); 732 733 for (;;) 734 { 735 ExecRow aRow = tableScan.getNextRowCore(); 736 if (aRow == null) 737 { 738 tableScan.sourceDrained = true; 739 tableScan.past2FutureTbl = null; break; 741 } 742 RowLocation rowLoc = (RowLocation) aRow.getColumn(aRow.nColumns()); 743 744 if (updatedRL.equals(rowLoc)) { 746 saveLastCusorKey(tableScan, aRow); 747 break; } 749 750 if (tableScan.futureForUpdateRows == null) 751 { 752 756 tableScan.futureForUpdateRows = new TemporaryRowHolderImpl 757 (activation, null, null, 100, false, true); 758 } 759 760 rlRow.setColumn(1, rowLoc); 761 tableScan.futureForUpdateRows.insert(rlRow); 762 if (past2FutureTbl.size() < maxCapacity) { 764 past2FutureTbl.put(updatedRL, updatedRL); 765 saveLastCusorKey(tableScan, aRow); 766 break; 767 } 768 } 769 tableScan.skipFutureRowHolder = false; 770 } 771 } 772 } 773 774 private void saveLastCusorKey(TableScanResultSet tableScan, ExecRow aRow) throws StandardException 775 { 776 781 if (tableScan.lastCursorKey == null) 782 tableScan.lastCursorKey = new ValueRow(aRow.nColumns() - 1); 783 for (int i = 1; i <= tableScan.lastCursorKey.nColumns(); i++) 784 { 785 DataValueDescriptor aCol = aRow.getColumn(i); 786 if (aCol != null) 787 tableScan.lastCursorKey.setColumn(i, aCol.getClone()); 788 } 789 } 790 791 void fireBeforeTriggers() throws StandardException 792 { 793 if (deferred) 794 { 795 if (triggerInfo != null) 796 { 797 if (triggerActivator == null) 798 { 799 triggerActivator = new TriggerEventActivator(lcc, 800 tc, 801 constants.targetUUID, 802 triggerInfo, 803 TriggerExecutionContext.UPDATE_EVENT, 804 activation, null); 805 } 806 else 807 { 808 triggerActivator.reopen(); 809 } 810 811 triggerActivator.notifyEvent(TriggerEvents.BEFORE_UPDATE, 813 deletedRowHolder.getResultSet(), 814 insertedRowHolder.getResultSet()); 815 816 } 817 } 818 } 819 820 void fireAfterTriggers() throws StandardException 821 { 822 if (deferred) 823 { 824 if (triggerActivator != null) 825 { 826 triggerActivator.notifyEvent(TriggerEvents.AFTER_UPDATE, 827 deletedRowHolder.getResultSet(), 828 insertedRowHolder.getResultSet()); 829 } 830 } 831 } 832 833 834 835 void updateDeferredRows() throws StandardException 836 { 837 if (deferred) 838 { 839 deferredBaseCC = 841 tc.openCompiledConglomerate( 842 false, 843 tc.OPENMODE_FORUPDATE|tc.OPENMODE_SECONDARY_LOCKED, 844 lockMode, 845 TransactionController.ISOLATION_SERIALIZABLE, 846 constants.heapSCOCI, 847 heapDCOCI); 848 849 CursorResultSet rs = insertedRowHolder.getResultSet(); 850 try 851 { 852 858 FormatableBitSet readBitSet = RowUtil.shift(baseRowReadList, 1); 859 ExecRow deferredTempRow2; 860 861 rs.open(); 862 while ((deferredTempRow2 = rs.getNextRow()) != null) 863 { 864 869 if (triggerInfo != null) 870 { 871 source.setCurrentRow(deferredTempRow); 872 evaluateCheckConstraints(checkGM, activation); 873 } 874 875 879 DataValueDescriptor rlColumn = deferredTempRow2.getColumn(numberOfBaseColumns + 1); 880 RowLocation baseRowLocation = 881 (RowLocation) (rlColumn).getObject(); 882 883 884 boolean row_exists = 885 deferredBaseCC.fetch( 886 baseRowLocation, deferredSparseRow.getRowArray(), 887 readBitSet); 888 889 if (SanityManager.DEBUG) 890 { 891 SanityManager.ASSERT(row_exists, "did not find base row in deferred update"); 892 } 893 894 899 RowUtil.copyRefColumns(newBaseRow, 900 deferredTempRow2, 901 numberOfBaseColumns); 902 903 rowChanger.updateRow(deferredBaseRow, 904 newBaseRow, 905 baseRowLocation); 906 source.updateRow(newBaseRow); 907 } 908 } finally 909 { 910 source.clearCurrentRow(); 911 rs.close(); 912 } 913 } 914 } 915 916 917 918 void runChecker(boolean restrictCheckOnly) throws StandardException 919 { 920 921 926 if (deferred && updatingReferencedKey) 927 { 928 ExecRow deletedRow; 929 CursorResultSet deletedRows; 930 931 934 for (int i = 0; i < fkInfoArray.length; i++) 935 { 936 if (fkInfoArray[i].type == FKInfo.FOREIGN_KEY) 937 { 938 continue; 939 } 940 941 deletedRows = deletedRowHolder.getResultSet(); 942 try 943 { 944 947 deletedRows.open(); 948 while ((deletedRow = deletedRows.getNextRow()) != null) 949 { 950 if (!foundRow(deletedRow, 951 fkInfoArray[i].colArray, 952 insertedRowHolder)) 953 { 954 riChecker.doRICheck(i, deletedRow, restrictCheckOnly); 955 } 956 } 957 } 958 finally 959 { 960 deletedRows.close(); 961 } 962 } 963 } 964 965 970 if (deferred && updatingForeignKey) 971 { 972 ExecRow insertedRow; 973 CursorResultSet insertedRows; 974 975 978 for (int i = 0; i < fkInfoArray.length; i++) 979 { 980 if (fkInfoArray[i].type == FKInfo.REFERENCED_KEY) 981 { 982 continue; 983 } 984 985 insertedRows = insertedRowHolder.getResultSet(); 986 try 987 { 988 991 insertedRows.open(); 992 while ((insertedRow = insertedRows.getNextRow()) != null) 993 { 994 if (!foundRow(insertedRow, 995 fkInfoArray[i].colArray, 996 deletedRowHolder)) 997 { 998 riChecker.doRICheck(i, insertedRow, restrictCheckOnly); 999 } 1000 } 1001 } 1002 finally 1003 { 1004 insertedRows.close(); 1005 } 1006 } 1007 } 1008 1009 } 1010 1011 public static boolean foundRow 1012 ( 1013 ExecRow checkRow, 1014 int[] colsToCheck, 1015 TemporaryRowHolderImpl rowHolder 1016 ) 1017 throws StandardException 1018 { 1019 ExecRow scanRow; 1020 boolean foundMatch = false; 1021 Object [] checkRowArray = checkRow.getRowArray(); 1022 DataValueDescriptor checkCol; 1023 DataValueDescriptor scanCol; 1024 1025 CursorResultSet rs = rowHolder.getResultSet(); 1026 try 1027 { 1028 1031 rs.open(); 1032 while ((scanRow = rs.getNextRow()) != null) 1033 { 1034 Object [] scanRowArray = scanRow.getRowArray(); 1035 int i; 1036 for (i = 0; i < colsToCheck.length; i++) 1037 { 1038 checkCol = (DataValueDescriptor)checkRowArray[colsToCheck[i]-1]; 1039 scanCol = (DataValueDescriptor)scanRowArray[colsToCheck[i]-1]; 1040 1041 BooleanDataValue result = checkCol.equals( 1042 scanCol, 1043 checkCol); if (!result.getBoolean()) 1045 { 1046 break; 1047 } 1048 } 1049 if (i == colsToCheck.length) 1050 { 1051 foundMatch = true; 1052 break; 1053 } 1054 } 1055 } 1056 finally 1057 { 1058 rs.close(); 1059 } 1060 return foundMatch; 1061 } 1062 1063 1064 1069 public void cleanUp() throws StandardException 1070 { 1071 numOpens = 0; 1072 1073 1074 if (source != null) 1075 { 1076 source.close(); 1077 } 1079 1080 if (triggerActivator != null) 1081 { 1082 triggerActivator.cleanup(); 1083 } 1085 1086 if (rowChanger != null) 1087 rowChanger.close(); 1088 1089 if (deferredBaseCC != null) 1090 deferredBaseCC.close(); 1091 deferredBaseCC = null; 1092 1093 if (insertedRowHolder != null) 1094 { 1095 insertedRowHolder.close(); 1096 } 1097 1098 if (deletedRowHolder != null) 1099 { 1100 deletedRowHolder.close(); 1101 } 1102 1103 if (riChecker != null) 1104 { 1105 riChecker.close(); 1106 } 1108 1109 super.close(); 1110 1111 endTime = getCurrentTimeMillis(); 1112 } 1113 1114 1136 protected static int decodeLockMode( 1137 LanguageConnectionContext lcc, 1138 int lockMode) 1139 { 1140 if ((lockMode >>> 16) != 0) 1141 { 1142 1147 int isolationLevel = lcc.getCurrentIsolationLevel(); 1148 1149 if (isolationLevel != ExecutionContext.SERIALIZABLE_ISOLATION_LEVEL) 1150 { 1151 lockMode = lockMode & 0xff; 1152 } 1153 else 1154 { 1155 lockMode = lockMode >>> 16; 1156 } 1157 } 1158 return lockMode; 1159 } 1160 1161 1162 void rowChangerFinish() throws StandardException 1163 { 1164 rowChanger.finish(); 1165 } 1166 1167} 1168 | Popular Tags |