1 23 24 29 30 package com.sun.enterprise.admin.monitor.callflow; 31 32 import com.sun.enterprise.admin.monitor.callflow.DbAccessObject; 33 import java.sql.Connection ; 34 import java.sql.DriverManager ; 35 import java.sql.PreparedStatement ; 36 import java.sql.ResultSet ; 37 import java.sql.SQLException ; 38 import java.sql.Statement ; 39 import java.util.ArrayList ; 40 import java.util.HashMap ; 41 import java.util.List ; 42 import java.util.Map ; 43 import javax.naming.InitialContext ; 44 import javax.naming.NamingException ; 45 import javax.sql.DataSource ; 46 import com.sun.enterprise.admin.monitor.callflow.RequestType; 47 import com.sun.appserv.management.monitor.CallFlowMonitor; 48 import java.util.logging.Level ; 49 import java.util.logging.Logger ; 50 import com.sun.enterprise.admin.common.constant.AdminConstants; 51 55 public class DbAccessObjectImpl implements DbAccessObject { 56 private static final Logger logger = 57 Logger.getLogger(AdminConstants.kLoggerName); 58 59 private static DbAccessObject _singleton = null; 60 61 private static final String CALLFLOW_POOL_JNDI_NAME = "jdbc/__CallFlowPool__pm"; 62 63 private TableAccessObject reqStart = null; 64 private TableAccessObject reqEnd = null; 65 private TableAccessObject methStart = null; 66 private TableAccessObject methEnd = null; 67 private TableAccessObject startTime = null; 68 private TableAccessObject endTime = null; 69 70 private Connection connection = null; 71 private PreparedStatement pstmtRS = null; 72 private PreparedStatement pstmtRE = null; 73 private PreparedStatement pstmtMS = null; 74 private PreparedStatement pstmtME = null; 75 private PreparedStatement pstmtST = null; 76 private PreparedStatement pstmtET = null; 77 78 private String serverName = null; 79 80 81 private DbAccessObjectImpl() { 82 reqStart = RequestStartAccessObjectImpl.getInstance(); 83 reqEnd = RequestEndAccessObjectImpl.getInstance(); 84 methStart = MethodStartAccessObjectImpl.getInstance(); 85 methEnd = MethodEndAccessObjectImpl.getInstance(); 86 startTime = StartTimeAccessObjectImpl.getInstance(); 87 endTime = EndTimeAccessObjectImpl.getInstance(); 88 } 89 90 92 public boolean enable () { 93 if(!setupConnection()){ 94 logger.log(Level.SEVERE, "callflow.connection_obtain_failed"); 95 logger.log(Level.SEVERE, "callflow.enable_failed"); 96 throw new RuntimeException ("Error obtaining connection to callflow database"); 97 } 98 boolean result = enable(connection); 99 if(result == true){ 100 try{ 101 createPreparedStatements(); 102 } catch (SQLException sqe){ 103 logger.log(Level.SEVERE, "callflow.enable_failed", sqe); 107 RuntimeException re = new RuntimeException (); 108 re.initCause(sqe); 109 throw re; 110 } finally { 111 closeConnection(); 112 } 113 } else if (result == false) { logger.log(Level.SEVERE, "callflow.enable_failed"); 118 closeConnection (); 119 throw new RuntimeException ("Error creating tables"); 120 } 121 return result; 122 } 123 private boolean enable (Connection connection) { 124 126 boolean rs = reqStart.createTable(connection); 127 if (!rs) 128 return false; 129 boolean re = reqEnd.createTable(connection); 130 if (!re) 131 return false; 132 boolean ms = methStart.createTable(connection); 133 if (!ms) 134 return false; 135 boolean me = methEnd.createTable(connection); 136 if (!me) 137 return false; 138 boolean st = startTime.createTable(connection); 139 if (!st) 140 return false; 141 boolean et = endTime.createTable(connection); 142 if (!et) 143 return false; 144 return true; 145 } 146 public boolean disable() { 147 closePreparedStatements(); 148 closeConnection(); 149 return true; 150 } 151 152 154 158 public static DbAccessObject getInstance() { 159 if(_singleton == null) 160 _singleton = new DbAccessObjectImpl (); 161 return _singleton; 162 } 163 164 public boolean clearData () { 165 if(!setupConnection()) 166 return false; 167 boolean result = clearData (connection); 168 closeConnection (); 169 return result; 170 } 171 private boolean clearData(Connection connection) { 172 174 boolean rs = reqStart.dropTable(connection); 175 boolean re = reqEnd.dropTable(connection); 176 boolean ms = methStart.dropTable(connection); 177 boolean me = methEnd.dropTable(connection); 178 boolean st = startTime.dropTable(connection); 179 boolean et = endTime.dropTable(connection); 180 181 if(rs == false || re == false || ms == false || me == false || 182 st == false || et == false) 183 return false; 184 return true; 185 186 } 187 189 191 private boolean setupConnection (){ 195 try{ 196 boolean standaloneDb = 198 Boolean.valueOf(System.getProperty("callflow.db.standalone")); 199 200 if (!standaloneDb) { 201 202 InitialContext ic = new InitialContext (); 203 DataSource ds = (DataSource )ic.lookup (CALLFLOW_POOL_JNDI_NAME); 204 connection = ds.getConnection(); 205 } else { 206 String url="jdbc:derby://localhost:1527/sun-callflow;retrieveMessagesFromServerOnGetMessage=true;create=true;"; 208 Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance(); 209 connection = DriverManager.getConnection(url, "APP", "APP"); 210 } 211 } catch (Exception e){ 212 logger.log(Level.SEVERE, "callflow.connection_obtain_failed", e); 213 return false; 214 } 215 return true; 216 } 217 private void closeConnection (){ 218 try{ 219 if(connection != null){ 220 connection.close(); 221 } 222 } catch (Exception e){ 223 logger.log(Level.WARNING, "Cannot close connection to CallFlow DB", e); 224 } finally { 225 connection = null; 226 } 227 } 228 229 private void createPreparedStatements () throws SQLException { 230 if(connection == null) 231 if(!setupConnection()) 232 return; 233 234 pstmtRS = connection.prepareStatement (reqStart.getInsertSQL()); 235 pstmtRE = connection.prepareStatement(reqEnd.getInsertSQL()); 236 pstmtMS = connection.prepareStatement(methStart.getInsertSQL()); 237 pstmtME = connection.prepareStatement(methEnd.getInsertSQL()); 238 pstmtST = connection.prepareStatement(startTime.getInsertSQL()); 239 pstmtET = connection.prepareStatement(endTime.getInsertSQL()); 240 241 } 242 private void closePreparedStatements () { 243 try{ 244 if(pstmtRS != null) 245 pstmtRS.close(); 246 } catch (SQLException s){ 247 logger.log(Level.FINE, "Could not close RequestStart SQL Statement", s); 249 }finally{ 250 pstmtRS = null; 251 } 252 try{ 253 if(pstmtRE != null) 254 pstmtRE.close(); 255 } catch (SQLException e){ 256 logger.log(Level.FINE, "Could not close RequestEnd SQL Statement", e); 258 }finally{ 259 pstmtRE = null; 260 } 261 try{ 262 if(pstmtMS != null) 263 pstmtMS.close(); 264 } catch (SQLException se){ 265 logger.log(Level.FINE, "Could not close MethodStart SQL Statement", se); 267 } finally{ 268 pstmtMS = null; 269 } 270 try{ 271 if(pstmtME != null) 272 pstmtME.close(); 273 } catch(SQLException sqe){ 274 logger.log(Level.FINE, "Could not close MethodEnd SQL Statement", sqe); 276 }finally{ 277 pstmtME = null; 278 } 279 try{ 280 if(pstmtST != null) 281 pstmtST.close(); 282 } catch(SQLException sqe){ 283 logger.log(Level.FINE, "Could not close StartTime SQL Statement", sqe); 285 }finally{ 286 pstmtST = null; 287 } 288 try{ 289 if(pstmtET != null) 290 pstmtET.close(); 291 } catch(SQLException sqe){ 292 logger.log(Level.FINE, "Could not close EndTime SQL Statement", sqe); 294 }finally{ 295 pstmtET = null; 296 } 297 298 } 299 300 302 public java.util.List <java.util.Map <String , String >> getRequestInformation() { 304 if(connection == null) 305 if(!setupConnection()) 306 return null; 307 assert connection != null; 308 List <Map <String , String >> list = null; 309 Statement stmt = null; 310 try{ 311 stmt = connection.createStatement(); 312 stmt.executeQuery( 313 generateQuerySQL(TableInfo.GET_REQUEST_INFORMATION_SQL)); 314 ResultSet rs = stmt.getResultSet(); 315 list = new ArrayList <Map <String , String >>(); 316 while(rs.next()){ 317 Map <String , String > map = new HashMap <String , String > (); 318 319 String request_id = rs.getString(TableInfo.REQUEST_ID); 320 map.put (CallFlowMonitor.REQUEST_ID_KEY, request_id); 321 long time_stamp = rs.getLong(TableInfo.TIME_STAMP_MILLIS); 323 map.put (CallFlowMonitor.TIME_STAMP_MILLIS_KEY, String.valueOf(time_stamp)); 324 325 String ip_address = rs.getString(TableInfo.IP_ADDRESS); 326 map.put (CallFlowMonitor.CLIENT_HOST_KEY, ip_address); 327 328 String request_type = rs.getString(TableInfo.REQUEST_TYPE); 329 map.put (CallFlowMonitor.REQUEST_TYPE_KEY, request_type); 330 331 String method_name = rs.getString(TableInfo.METHOD_NAME); 332 map.put (CallFlowMonitor.METHOD_NAME_KEY, method_name); 333 334 String app_name = rs.getString(TableInfo.APP_NAME); 335 map.put (CallFlowMonitor.APPLICATION_NAME_KEY, app_name); 336 337 String security_id = rs.getString (TableInfo.SECURITY_ID); 338 map.put (CallFlowMonitor.USER_KEY, security_id); 339 340 String exception_name = rs.getString(TableInfo.EXCEPTION_NAME); 341 map.put (CallFlowMonitor.EXCEPTION_KEY, exception_name); 342 343 long time_taken = rs.getLong(10); 344 map.put (CallFlowMonitor.RESPONSE_TIME_KEY, String.valueOf(time_taken)); 345 346 list.add(map); 347 } 348 349 } catch (SQLException se){ 350 logger.log(Level.WARNING, "callflow.error_get_request_info"); 352 logger.log(Level.FINE, "callflow.error_sql_execute", se); 353 } 354 closeConnection(); 355 return list; 356 } 357 359 private String generateQuerySQL (String sql){ 360 String newsql = new String (sql); 362 String table = TableInfo.REQUEST_START_TABLE_NAME; 364 String tableWithServerName = getTableWithServerName (table); 365 newsql = newsql.replaceAll(table, tableWithServerName); 366 table = TableInfo.REQUEST_END_TABLE_NAME; 368 tableWithServerName = getTableWithServerName (table); 369 newsql = newsql.replaceAll(table, tableWithServerName); 370 371 table = TableInfo.METHOD_START_TABLE_NAME; 373 tableWithServerName = getTableWithServerName (table); 374 newsql = newsql.replaceAll(table, tableWithServerName); 375 376 table = TableInfo.METHOD_END_TABLE_NAME; 378 tableWithServerName = getTableWithServerName (table); 379 newsql = newsql.replaceAll(table, tableWithServerName); 380 return newsql; 381 } 382 383 private String getTableWithServerName (String oldTableName) { 384 if (serverName == null) 385 serverName = reqStart.getServerInstanceName (); 386 387 return oldTableName + serverName; 388 } 389 390 391 public List <Map <String , String >> getCallStackInformation (String requestId) { 393 if(connection == null) 394 if(!setupConnection()) 395 return null; 396 assert connection != null; 397 List list = null; 398 PreparedStatement stmt = null; 399 try{ 400 String sql = generateQuerySQL (TableInfo.GET_CALLSTACK_INFORMATION_SQL); 401 stmt = connection.prepareStatement(sql); 402 403 stmt.setString(1, requestId); 404 stmt.setString(2, requestId); 405 stmt.setString(3, requestId); 406 stmt.setString(4, requestId); 407 ResultSet rs = stmt.executeQuery(); 408 list = new ArrayList <Map <String , String >>(); 409 while(rs.next()){ 410 Map <String , String > map = new HashMap <String , String > (); 411 412 String table_type = rs.getString(TABLE_TYPE_INDEX_CSI); 413 table_type = table_type.trim(); 414 map.put(CallFlowMonitor.CALL_STACK_ROW_TYPE_KEY, table_type); 415 if (CallFlowMonitor.CALL_STACK_REQUEST_START.equals(table_type)){ 416 map = getCallStackRequestStartInformation(rs, map); 417 } else if (CallFlowMonitor.CALL_STACK_REQUEST_END.equals(table_type)) { 418 map = getCallStackRequestEndInformation(rs, map); 419 } else if (CallFlowMonitor.CALL_STACK_METHOD_END.equals(table_type)){ 420 map = getCallStackMethodEndInformation(rs, map); 421 } else if (CallFlowMonitor.CALL_STACK_METHOD_START.equals(table_type)){ 422 map = getCallStackMethodStartInformation(rs, map); 423 } 424 list.add(map); 425 } 426 stmt.close(); 427 } catch (SQLException se){ 428 logger.log(Level.FINE, "callflow.error_get_callstack_info", se); 430 } 431 closeConnection(); 432 return list; 433 } 434 private Map <String , String > getCallStackCommonInformation (ResultSet rs, 435 Map <String , String > map) throws SQLException 436 { 437 438 String request_id = rs.getString(TableInfo.REQUEST_ID); 440 map.put(CallFlowMonitor.REQUEST_ID_KEY, request_id); 441 442 long time_stamp = rs.getLong(TIMESTAMP_INDEX_CSI); 443 map.put(CallFlowMonitor.TIME_STAMP_KEY, String.valueOf(time_stamp)); 444 445 long time_stamp_millis = rs.getLong (TIMESTAMP_MILLIS_INDEX_CSI); 446 map.put (CallFlowMonitor.TIME_STAMP_MILLIS_KEY, String.valueOf(time_stamp_millis)); 447 448 return map; 449 } 450 451 private Map <String , String > getCallStackRequestEndInformation (ResultSet rs, 452 Map <String , String > map) throws SQLException 453 { 454 map = getCallStackCommonInformation(rs, map); 455 return map; 456 } 457 458 private Map <String , String > getCallStackRequestStartInformation (ResultSet rs, 459 Map <String , String > map) throws SQLException { 460 map = getCallStackCommonInformation(rs, map); 461 String request_type = rs.getString(REQUEST_TYPE_INDEX_CSI); 462 map.put (CallFlowMonitor.REQUEST_TYPE_KEY, request_type); 463 return map; 464 } 465 466 private Map <String , String > getCallStackMethodEndInformation (ResultSet rs, 467 Map <String , String > map) throws SQLException { 468 map = getCallStackCommonInformation(rs, map); 469 String exception_name = rs.getString(EXCEPTION_NAME_INDEX_CSI); 470 map.put(CallFlowMonitor.EXCEPTION_KEY, exception_name); 471 String status = 472 (exception_name == null)? String.valueOf(Boolean.TRUE) : 473 String.valueOf(Boolean.FALSE); 474 map.put(CallFlowMonitor.STATUS_KEY, status); 475 return map; 476 477 } 478 479 private Map <String , String > getCallStackMethodStartInformation (ResultSet rs, 480 Map <String , String > map) throws SQLException { 481 map = getCallStackCommonInformation(rs, map); 482 String container_type = rs.getString(CONTAINER_TYPE_INDEX_CSI); 483 map.put(CallFlowMonitor.CONTAINER_TYPE_KEY, container_type); 484 485 String component_name = rs.getString(COMPONENT_NAME_INDEX_CSI); 486 map.put(CallFlowMonitor.COMPONENT_NAME_KEY, component_name); 487 488 String app_name = rs.getString(APP_NAME_INDEX_CSI); 489 map.put (CallFlowMonitor.APPLICATION_NAME_KEY, app_name); 490 491 String method_name = rs.getString(METHOD_NAME_INDEX_CSI); 492 map.put (CallFlowMonitor.METHOD_NAME_KEY, method_name); 493 494 String module_name = rs.getString(MODULE_NAME_INDEX_CSI); 495 map.put(CallFlowMonitor.MODULE_NAME_KEY, module_name); 496 497 String thread_id = rs.getString(THREAD_ID_INDEX_CSI); 498 map = getCallStackCommonInformation(rs, map); 499 String exception_name = rs.getString(EXCEPTION_NAME_INDEX_CSI); 500 map.put(CallFlowMonitor.EXCEPTION_KEY, exception_name); 501 String status = 502 (exception_name == null)? String.valueOf(Boolean.TRUE) : 503 String.valueOf(Boolean.FALSE); 504 map.put(CallFlowMonitor.STATUS_KEY, status); 505 return map; 506 507 } 508 510 public boolean insert(TransferObject[] transferObject) { 512 boolean result = false; 513 514 if (transferObject.length == 0) return true; 516 517 if (transferObject[0] instanceof RequestStartTO){ 518 result = 519 (pstmtRS == null)? false: reqStart.insert(pstmtRS, transferObject); 520 } else if (transferObject[0] instanceof RequestEndTO){ 521 result = 522 (pstmtRE == null)? false : reqEnd.insert(pstmtRE, transferObject); 523 } else if (transferObject[0] instanceof MethodStartTO){ 524 result = 525 (pstmtMS == null)? false : methStart.insert(pstmtMS, transferObject); 526 } else if (transferObject[0] instanceof MethodEndTO){ 527 result = 528 (pstmtME == null)? false : methEnd.insert(pstmtME, transferObject); 529 } else if (transferObject[0] instanceof StartTimeTO){ 530 result = 531 (pstmtST == null)? false : startTime.insert(pstmtST, transferObject); 532 } else if (transferObject[0] instanceof EndTimeTO){ 533 result = 534 (pstmtET == null)? false : endTime.insert(pstmtET, transferObject); 535 } 536 return result; 537 } 538 540 public Map <String , String > getPieInformation(String requestId) { 542 closeConnection(); 543 connection = null; 544 if(connection == null) 545 if(!setupConnection()) 546 return null; 547 Map <String , String > mapST = null; 548 Map <String , String > mapET = null; 549 Map <String , String > retMap = null; 550 PreparedStatement st = null; 551 PreparedStatement et = null; 552 try{ 553 String startSql = 554 generateQuerySQLForStartTimeAndEndTime (TableInfo.GET_PIE_INFORMATION_START_TIME_SQL); 555 st = connection.prepareStatement(startSql); 556 st.setString (1, requestId); 557 ResultSet rs = st.executeQuery(); 558 mapST = new HashMap <String , String >(); 559 while(rs.next()){ 560 String container_type = rs.getString(1); 561 long time_taken = rs.getLong(2); 562 mapST.put(container_type, String.valueOf(time_taken)); 563 } 564 st.close(); 565 String endSql = 566 generateQuerySQLForStartTimeAndEndTime (TableInfo.GET_PIE_INFORMATION_END_TIME_SQL); 567 et = connection.prepareStatement(endSql); 568 et.setString (1, requestId); 569 rs = et.executeQuery(); 570 mapET = new HashMap <String , String >(); 571 while(rs.next()){ 572 String container_type = rs.getString(1); 573 long time_taken = rs.getLong(2); 574 mapET.put(container_type, String.valueOf(time_taken)); 575 } 576 et.close(); 577 retMap = new HashMap <String , String > (); 578 579 for (String key : mapST.keySet()){ 580 String stime = mapST.get(key); 581 if (stime == null) 582 continue; 583 long startTime = Long.valueOf(stime); 584 String etime = mapET.get(key); 585 if (etime == null ) 586 continue; 587 long endTime = Long.valueOf(etime); 588 long time_taken = endTime - startTime; 589 retMap.put (key, String.valueOf (time_taken)); 590 } 591 592 } catch (SQLException se){ 593 logger.log(Level.FINE, "callflow.error_get_pie_info", se); 595 } 596 closeConnection(); 597 return retMap; 598 } 599 private String generateQuerySQLForStartTimeAndEndTime (String sql){ 600 String newsql = new String (sql); 602 String table = TableInfo.START_TIME_TABLE_NAME; 604 String tableWithServerName = getTableWithServerName (table); 605 newsql = newsql.replaceAll(table, tableWithServerName); 606 table = TableInfo.END_TIME_TABLE_NAME; 608 tableWithServerName = getTableWithServerName (table); 609 newsql = newsql.replaceAll(table, tableWithServerName); 610 return newsql; 611 } 612 613 615 620 private int SECURITY_ID_INDEX_CSI = 13; 621 622 private int TRANSACTION_ID_INDEX_CSI = 12; 623 624 private int THREAD_ID_INDEX_CSI = 11; 625 626 private int MODULE_NAME_INDEX_CSI = 10; 627 628 private int METHOD_NAME_INDEX_CSI = 9; 629 630 private int APP_NAME_INDEX_CSI = 8; 631 632 private int COMPONENT_NAME_INDEX_CSI = 7; 633 634 private int CONTAINER_TYPE_INDEX_CSI = 6; 635 636 private int EXCEPTION_NAME_INDEX_CSI = 5; 637 638 private int REQUEST_TYPE_INDEX_CSI = 4; 639 640 private int TIMESTAMP_INDEX_CSI = 3; 641 642 private int TABLE_TYPE_INDEX_CSI = 1; 643 644 private int TIMESTAMP_MILLIS_INDEX_CSI = 14; 645 647 public boolean deleteRequestIds (String [] requestIds) { 648 if (requestIds.length <=0 ) 649 return true; 650 651 boolean resultRS = false; 652 boolean resultRE = false; 653 boolean resultMS = false; 654 boolean resultME = false; 655 boolean resultCS = false; 656 boolean resultCE = false; 657 658 PreparedStatement rs = null; 659 PreparedStatement re = null; 660 PreparedStatement ms = null; 661 PreparedStatement me = null; 662 PreparedStatement st = null; 663 PreparedStatement et = null; 664 665 666 if (connection == null) 667 if (!setupConnection()) 668 return false; 669 try { 670 rs = connection.prepareStatement(reqStart.getDeleteSQL()); 671 resultRS = (rs == null)? false : reqStart.delete(rs, requestIds); 672 if (!resultRS) 673 logger.log (Level.FINE, "Error deleting requests from Request Start Table"); 674 } catch (SQLException se){ 675 logger.log (Level.FINE, "Error deleting requests from Request Start Table", se); 676 }finally { 677 if (rs != null){ 678 try{ 679 rs.close(); 680 } catch (SQLException se){ 681 } finally { 683 rs = null; 684 } 685 } 686 } 687 try{ 688 re = connection.prepareStatement(reqEnd.getDeleteSQL()); 689 resultRE = (re == null)? false : reqEnd.delete(re, requestIds); 690 if (!resultRE) 691 logger.log (Level.FINE, "Error deleting requests from Request End Table"); 692 } catch (SQLException se){ 693 logger.log (Level.FINE, "Error deleting requests from Request End Table", se); 694 } finally { 695 if (re != null){ 696 try{ 697 re.close(); 698 } catch (SQLException se){ 699 } finally { 701 re = null; 702 } 703 } 704 } 705 try{ 706 ms = connection.prepareStatement(methStart.getDeleteSQL()); 707 resultMS = (ms == null)? false : methStart.delete(ms, requestIds); 708 if (!resultMS) 709 logger.log (Level.FINE, "Error deleting requests from Method Start Table"); 710 } catch (SQLException se){ 711 logger.log (Level.FINE, "Error deleting requests from Method Start Table", se); 712 }finally { 713 if (ms != null){ 714 try{ 715 ms.close(); 716 } catch (SQLException se){ 717 } finally { 719 ms = null; 720 } 721 } 722 } 723 724 try{ 725 me = connection.prepareStatement(methEnd.getDeleteSQL()); 726 resultME = (me == null)? false : methEnd.delete(me, requestIds); 727 if (!resultME) 728 logger.log (Level.FINE, "Error deleting requests from Method End Table"); 729 } catch (SQLException se){ 730 logger.log (Level.FINE, "Error deleting requests from MethodEnd Table", se); 731 }finally { 732 if (me != null){ 733 try{ 734 me.close(); 735 } catch (SQLException se){ 736 } finally { 738 me = null; 739 } 740 } 741 } 742 743 try{ 744 st = connection.prepareStatement(startTime.getDeleteSQL()); 745 resultCS = (st == null)? false : startTime.delete(st, requestIds); 746 if (!resultCS) 747 logger.log (Level.FINE, "Error deleting requests from Container Start Table"); 748 } catch (SQLException se){ 749 logger.log (Level.FINE, "Error deleting requests from Container Start Table", se); 750 }finally { 751 if (st != null){ 752 try{ 753 st.close(); 754 } catch (SQLException se){ 755 } finally { 757 st = null; 758 } 759 } 760 } 761 try{ 762 et =connection.prepareStatement(endTime.getDeleteSQL()); 763 resultCE = (et == null)? false : endTime.delete(et, requestIds); 764 if (!resultCE) 765 logger.log (Level.FINE, "Error deleting requests from Container End Table"); 766 } catch (SQLException se){ 767 logger.log (Level.FINE, "Error deleting requests from End time Table", se); 768 }finally { 769 if (et != null){ 770 try{ 771 et.close(); 772 } catch (SQLException se){ 773 } finally { 775 et = null; 776 } 777 } 778 } 779 if (resultRS && resultRE && resultMS && resultME && resultCS && resultCE) 780 return true; 781 return false; 782 } 783 } 784 | Popular Tags |