cannot communicate with the broker

by 차가워여 posted Sep 28, 2009
connection 후 1천만 건을 insert 하였습니다. 테이블은 만든 상태이고여..
근데 insert 를 하다보면. 몇천건을 쓰다 몇만건을 쓰다
cannot communicate with the broker 라고 발생하면서 broker 하고 연결이 disconnect 됩니다.

문제점이 무엇인지요??

cubrid_broker.conf 에 keep_connection 도 on으로 변경 했는데 마찬가지거든요..

jdbc 를 사용합니다.

  public static void main(String[] args) throws Exception{
       Connection conn = null;
       PreparedStatement pstmt = null;
      
       try{
           Class.forName("cubrid.jdbc.driver.CUBRIDDriver");
           conn = DriverManager.getConnection("jdbc:CUBRID:localhost:33000:test:::", "test", "testdb");

            int count = 0;
            while(count < 10000000){
                String sql = insert into test_tbl ( code, sex, name ) values ( ?, ?, ? )" ;
                pstmt = conn.prepareStatement(sql);
                pstmt.setString(1, ""+System.nanoTime());
                pstmt.setInt(2, 1);
                pstmt.setBytes(3, "11111".getBytes());

                int row = pstmt.executeUpdate();

                if ( row > 0 ){
                    conn.commit();
                    count++;
                }
             }

            stmt.close();
            conn.close();

            } catch ( SQLException e ) {
               System.err.println(e.getMessage());
            } catch ( Exception e ) {
               System.err.println(e.getMessage());
            } finally {
                if ( conn != null ) conn.close();
            }
     }


Articles