Background Image

FORUM

조회 수 20002 추천 수 0 댓글 7
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
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();
            }
     }

  • ?
    손승일 2009.09.29 02:00

    CUBRID 상세 버전을 알려 주시기 바랍니다.
    내부에서 현재 버전인 2008 R2.0에서 테스트 한 결과 30만건이 들어 가는 동안에도 에러가 발생하지 않고 있습니다.
    broker 설정은 디폴트로 설정된 상태 그대로 사용하였습니다.
    참고로 아래는 제가 테스트한 소스입니다. 테이블은 create table test_tbl(code varchar(50), sex int, name bit varying(20));으로 생성했습니다. 테스트 하신 내용과 다른 부분이 있으시면 알려 주시기 바랍니다.
    import  java.sql.*;

    public class INSERT {

    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:36000:demodb:::", "", "");

                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++;
                    }
                 }

                pstmt.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();
                }
         }
    }


  • ?
    차가워여 2009.09.29 03:09
    code varchar(30), sex int, name bit varying(20) 으로 하였습니다.
    버젼은 2008 R2.0 을 사용하였습니다. 자바 complier 버젼은 6.0을 사용 하였고요. 처음에 name 값을 char에서 bit varying 으로 바꾸어도 똑같네여...어쩔때는 20만 건 정도 쓰다가 Exception 이 날때도 있고 1만 건 쓰다가 오류 날때도 있네여... cubrid_broker.conf 파일은 디폴트 상태입니다.
  • ?
    손승일 2009.09.30 03:48
    내부 테스트 결과 300만건 이상 처리되는 동안에도 에러가 발생하지 않고 있습니다.
    에러 내용을 좀더 상세히 알아보기 위해 System.err.println(e.getMessage());을 e.printStackTrace();로 변경해서 결과를 알려주시기 바랍니다.
    테스트 환경이 동일한 장비에서 DB서버와 java 프로그램이 함께 작동하는 지 아니면 별개의 서버에서 리모트로 접속하는지도 알려 주세요.

  • ?
    차가워여 2009.10.01 21:05
    cubrid.jdbc.driver.CUBRIDException: Cannot communicate with the broker
     at cubrid.jdbc.driver.CUBRIDConnection.prepare(CUBRIDConnection.java:674)
     at cubrid.jdbc.driver.CUBRIDConnection.prepare(CUBRIDConnection.java:834)
     at cubrid.jdbc.driver.CUBRIDConnection.prepareStatement(CUBRIDConnection.java:135)

    이렇게 오류가 뜹니다.
  • ?
    2009.10.06 01:13
    위 덧글에 몇가지 추가 확인 요청드렸는데 답변을 안주셨네요. 확인 부탁드립니다.
    더불어 재현을 위해 조금이라도 특이한 사항이 있으시면 알려 주시기 바랍니다. 
    DB가 운영되는 시스템의 메모리 사양, 함께 기동되고 있는 프로그램 등.
    또한 가능하면 시스템 재부팅 후 DB서버만 기동된 상태에서의 확인도 부탁드립니다.
  • ?
    차가워여 2009.10.06 23:35
    cubrid.jdbc.driver.CUBRIDException: Cannot communicate with the broker
     at cubrid.jdbc.driver.CUBRIDConnection.prepare(CUBRIDConnection.java:674)
     at cubrid.jdbc.driver.CUBRIDConnection.prepare(CUBRIDConnection.java:834)
     at cubrid.jdbc.driver.CUBRIDConnection.prepareStatement(CUBRIDConnection.java:135)

    printStackTrace() 결과는 위에 상기 하였고여. 따로 리모트연결은 하지 않고 CUBRID Manager Client와 이클립스에서 소스 설명 했던 부분만 올린 상태에서 실행 했을 때의 결과 입니다. 시스템 재부팅후에 결과도 마찬가지 입니다. CONFIG쪽은 처음 CUBRID설치때와 똑같고요..
  • ?
    손승일 2009.10.08 03:16
    저희쪽에서는 여전히 재현이 안 되고 있습니다.
    혹시 다른 장비가 있으시면 동일한 테스트를 다른 장비에서 수행 보시고 결과를 알려주시기 바랍니다.

  1. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4257
    read more
  2. 전송 연결 현재 연결은 원격 호스트에 의해 강제로 끊겼습니다

    Date2013.04.12 By바람바람 Views20684
    Read More
  3. 윈도우7+iis(7.5)+php5+cubrid에 xe 설치 후에 초기하면에 빨간색 글들.

    Date2009.12.26 ByHyuk-kwony Views20649
    Read More
  4. java.lang.ClassNotFoundException: cubrid.jdbc.dirver.CUBRIDDriver 에러에 관한문의

    Date2009.05.12 By삽질중 Views20644
    Read More
  5. MySQL의 LOAD DATA INFILE 기능은 CUBRID에 없나요?

    Date2009.05.13 By공기청정기 Views20623
    Read More
  6. 큐브리드 deb 패키징중...

    Date2009.03.19 By강분도 Views20577
    Read More
  7. jdbc 사용중 테이블 데이터 입력문제

    Date2011.12.22 ByDezert Views20502
    Read More
  8. rownum은 order by에 영향을 안 받네요

    Date2009.03.04 By안지민 Views20481
    Read More
  9. 델파이 등 4GL 언어에서 사용할 수 있는 인터페이스는 없나요?

    Date2009.05.27 By이상탁 Views20384
    Read More
  10. 백업시 lgar 파일이 지워지지 않는 문제

    Date2011.06.11 By동현 Views20359
    Read More
  11. attempt to exceed the maximum allowed nesting level(400) 에러 문의

    Date2016.11.24 Byfinkle Views20339
    Read More
  12. HA 문의 드립니다.

    Date2011.05.26 By뽀로꾸 Views20226
    Read More
  13. 큐브리드에 데이타 타입 지정문제

    Date2009.12.26 By지니보이 Views20198
    Read More
  14. HTML 게시판 작성후 데이타베이스 연결 방법?

    Date2011.12.09 By하늘과땅 Views20146
    Read More
  15. 테이블 목록확인 (show tables) 방법 문의

    Date2011.09.20 Bymkengnr Views20141
    Read More
  16. java.lang.ClassNotFoundException 에러가 납니다.

    Date2010.11.03 By코딩셔틀 Views20102
    Read More
  17. C++(MFC 아님)에서 프로그래밍 작성을 하려면 어떤것을 사용해야 하나요?

    Date2009.03.24 By나동호 Views20052
    Read More
  18. cannot communicate with the broker

    Date2009.09.28 By차가워여 Views20002
    Read More
  19. 에러 코드 질문 드립니다.

    Date2009.05.02 By빵돌이 Views19958
    Read More
  20. select @@identity

    Date2009.06.27 By펭귄 Views19896
    Read More
  21. MS949를 UTF-8 변경 방법

    Date2011.03.25 By혀니짱 Views19848
    Read More
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 199 Next
/ 199

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales