둘러보기 생략.
 

QueryService의 batchUpdate, batchRemove, batchInsert 사용 문의

안녕하세요.
QueryService를 사용하여 batchRemove 및 batchInsert를 사용하는데 문의사항이 있어 질문드립니다.
User Define DTO를 담은 ArrayList 형태의 리스트로 실행하였는데요, Exception이 발생하면서 동작하질 않네요.
세부 오류 내용은 이하와 같습니다.
org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [..<비표시>..]
Error for batch element #1: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=4, TABLEID=307, COLNO=0, DRIVER=3.50.152; nested exception is com.ibm.db2.jcc.b.lm: Error for batch element #1: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=4, TABLEID=307, COLNO=0, DRIVER=3.50.152
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:228)
.... <중략>

물론 테이블 맵핑정의 및 Primary Key정보는 정확한지 확인했구요,
Batch방식이 아닌 Loop를 이용한 1건씩 remove, insert로는 동작에 이상이 없는것도 확인 했습니다.

실행한 간략환경은 이하와 같으며 누군가 도움 주시면 감사드리겠습니다.
- Java Version : 1.5
- DBMS : DB2 v.9
- Use Anyframe Core (query)
anyframe.core.query-3.1.1.jar
anyframe.core.query.ext-3.1.1.jar
anyframe.core.query.ria-3.1.1.jar

그럼 수고하세요.

QueryService의 batchUpdate, batchRemove, batchInsert 사용 문의

기술해주신 Exception 메시지만으로는 원인을 파악하기 힘들 것 같습니다.
실행한 테스트 코드, XML 파일, DTO 파일 정보를 보여 주시면 테스트 해 보도록 하겠습니다.


일반적으로 DB2 Version 9.5 환경에서 DTO List를 이용한 batchInsert, batchUpdate, batchRemove는 정상적으로 동작하는 것을 확인했습니다. 다음은 테스트 메소드에 대한 일부 내용입니다.

public void testBatchUpdateByObject() throws Exception {
  // 1. insert data by object
  batchInsertByObject();

  // 2. set data for update
  ArrayList args = new ArrayList();
  BatchTestVO batchTestVO = new BatchTestVO();
  batchTestVO.setCol1("I1BatchCreateByObject");
  batchTestVO.setCol2("Modified");
  batchTestVO.setCol3(101);
  args.add(batchTestVO);
  batchTestVO = new BatchTestVO();
  batchTestVO.setCol1("I2BatchCreateByObject");
  batchTestVO.setCol2("Modified");
  batchTestVO.setCol3(102);
  args.add(batchTestVO);
  batchTestVO = new BatchTestVO();
  batchTestVO.setCol1("I3BatchCreateByObject");
  batchTestVO.setCol2("Modified");
  batchTestVO.setCol3(103);
  args.add(batchTestVO);

  // 3. execute query
  int[] rtVal = queryService.batchUpdate(args);
  assertTrue("Fail to batch update by object.", rtVal.length == 3);

  // 4. assert
  ArrayList rtList =
    (ArrayList) queryService.find("findBatchTest", new Object[] {});

  assertTrue("Fail to find.", rtList.size() == initCount + 3);
  for (int i = 0; i < rtList.size(); i++) {
    Map result = (Map) rtList.get(i);
    assertEquals("Fail to batch update a specified column.",
      "Modified", result.get("col2"));
  }
}

DataSource 설정은 다음과 같습니다.

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  <property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver"/>
  <property name="url" value="jdbc:db2://localhost:50000/data"/>
  <property name="username" value="user"/>
  <property name="password" value="password"/>
</bean>

위 테스트 코드는 JDK 1.5, DB2 9.5, Anyframe Core 3.2.0 기반에서 테스트되었습니다.

Brand Coach Purses Outlet

Brand

Coach Purses Outlet

are one of the best handbags series in the market for females nowadays. The

Coach Factory Outlet

series do make ladies become more charming and outstanding if they choose the most suitable one, which could be used in a variety of occasions.

Coach Factory Online

female will be the actuality the fact

Coach Outlet Online

that long-term history of

Coach Outlet Online

. No just one could deny the big accomplishment that

Coach Factory

made all through our existence

Coach outlet online

and will operate

Coach Outlet Online

accomplishment toward future. We all know

Coach Outlet

has the great excellent as nicely as one of

Coach Factory Outlet

the most great factors they choose. Of

Coach Outlet

instruction program this just one is worth to individual

Coach handbags outlet

with very good good quality and awesome craftsmanship

cheap coach purses

.

Coach Factory

New Arrivals are cozy products

Coach Factory Online

that occur to be fashionable

Coach Factory Outlet

, fashionable and definitely

Coach Factory Outlet Online

practical. You can begin

Coach Outlet Canada

searching during the craze of

Coach Outlet

New Arrivals and

Coach Factory

carrying them is your individual character

Coach Factory Online

and style. They

Coach Factory Outlet

may be utilized to fixture

Coach Factory Online

with diverse outfits

Cheap Coach Purses

definitely. It might be

Discount Coach Handbags

the softness inside of the leather

discount coach purses

, the security inside of

Coach Outlet Online

the lock closure

Coach Factory Online

, as correctly

Coach Factory Outlet Online

since the distinctive

Coach Factory

sort that provides

Coach Outlet Online

about a woman to adore

Coach Outlet Store Online

New Arrivals. However, for

Cheap Coach handbags

just about any one, you can go to

Coach Factory Outlet Online


over the internet shop to acquire for the variety,

Coach Factory

diversity and minimal price

Coach Factory Canada

. Coach Shoulder Bags developed of totally different elements are well-known as correctly since the leaders. Because

Coach Factory Outlet


over the

Coach Factory Outlet Online

is so attainable due to

Coach Purses Outlet

the fact of its decrease prices

Coach Outlet Store Online

, it has turn into among the most well-known

Coach Factory Online

to date

Coach Outlet Online Store

.