데이터 insert 시 DB 멈추는 현상

by 하루야 posted Apr 18, 2013

* 질문 등록 시 다음의 내용을 꼭 기입하여 주세요.
OS
Server 2008 R2
CUBRID Ver.
9.1
CUBRID TOOL Ver.
2013 manager
응용 환경(API)
java

* CUBRID 응용 오류, SQL 오류 또는 SQL 튜닝 관련된 문의는 반드시 다음의 내용을 추가해 주세요. 비밀글이나 비밀 댓글도 가능합니다.
* 저희가 상황을 이해하고, 재현이 가능해야 알 수 있는 문제들이 많습니다. 가능한 정보/정황들을 부탁합니다.
에러 내용 및 재현 방법 재현 가능한 Source와 SQL
관련 테이블(인덱스, 키정보 포함) 정보 CUBRID 홈 디렉토리 아래 log 디렉토리 압축


-------------- 아래에 질문 사항을 기입해 주세요. ------------------------------------------------------------------------

04/18/13 13:41:26.598  ERROR        file ....srcconnectionserver_support.c, line 2473 ERROR CODE = -970 Tran = 0, CLIENT = (unknown):(unknown)(-1), EID = 1 : Server HA mode is changed from 'idle' to 'active'. 
이런 메세지가 떨어지면서 서버가 죽어버립니다.

기존에 2008 에서 작동하던 프로그램 들이구요..

HA관련 에러인데 HA설정도 하지 않앗습니다. 이거 말고 다른 오류를 뽑아내거나 해야되나요?

 

Connection conn = null;
  PreparedStatement pstmt = null;
  try {
   conn = pool.getConnection();
   conn.setAutoCommit(true);

   StringBuffer SQL = new StringBuffer();
   SQL.append("INSERT ");
   SQL.append("INTO ");
   SQL.append("    IVU_T_AST_HWSVR ");
   SQL.append("    ( ");
   SQL.append("        HOSTNAME , ");
   SQL.append("        [ALIAS] , ");
   SQL.append("        MODEL , ");
   SQL.append("        [SERIAL] , ");
   SQL.append("        VENDOR , ");
   SQL.append("        LOCATION_ID , ");
   SQL.append("        USE_ID ");
   SQL.append("    ) ");
   SQL.append("SELECT ");
   SQL.append("    ''||? AS HOSTNAME , ");
   SQL.append("    ''||? AS [ALIAS] , ");
   SQL.append("    ''||? AS MODEL , ");
   SQL.append("    ''||? AS [SERIAL] , ");
   SQL.append("    ''||? AS VENDOR , ");
   SQL.append("    ''||? AS LOCATION_ID , ");
   SQL.append("    ''||? AS USE_ID ");
   SQL.append("FROM ");
   SQL.append("    DB_ROOT ON DUPLICATE KEY ");
   SQL.append("UPDATE ");
   SQL.append("    MODEL =''||? , ");
   SQL.append("    [SERIAL] =''||? , ");
   SQL.append("    VENDOR =''||? , ");
   SQL.append("    LOCATION_ID =''||? , ");
   SQL.append("    USE_ID =''||?");  
   
   pstmt = conn.prepareStatement( SQL.toString() );

   for (ITMSoapObject soapObject : itmSoapObjs) {
    pstmt.setString(1, soapObject.getValue("System_Name").replaceAll("Primary:", "").replaceAll(":NT", ""));
    pstmt.setString(2, soapObject.getValue("System_Name").replaceAll("Primary:", "").replaceAll(":NT", ""));
    pstmt.setString(3, soapObject.getValue("Computer_Name"));
    pstmt.setString(4, soapObject.getValue("Computer_UUID_Number"));
    pstmt.setString(5, code.get( soapObject.getValue("Computer_Vendor")));
    pstmt.setString(6, "60000");  // 디폴트
    pstmt.setString(7, "50002");  // 디폴트
    pstmt.setString(8, soapObject.getValue("Computer_Name"));
    pstmt.setString(9, soapObject.getValue("Computer_UUID_Number"));
    pstmt.setString(10, code.get( soapObject.getValue("Computer_Vendor")));
    pstmt.setString(11, "60000");  // 디폴트
    pstmt.setString(12, "50002");  // 디폴트

    //pstmt.addBatch();
    pstmt.executeUpdate();
   }
   conn.commit();
   //System.out.println("Update count : " +  pstmt.executeBatch().length);
  } catch (SQLException e) {
   e.printStackTrace();
  } catch (Exception e) {
   e.printStackTrace();

  } finally {
   Utils.releaseResource(pstmt, conn);
  }

 

위 소스는 해당 insert 관련 부분입니다.

 


Articles