websphere 컨테이너 관리 지속성을 사용하고 있지만, EntityManager.persist는 Derby 데이터베이스에 삽입/저장하지 않습니다.JPA/JTA 컨테이너 관리 지속성이 유지되지 않습니다.
@TransactionManagement(TransactionManagementType.CONTAINER)
@Stateless
@SessionScoped
public class claimSessionBean implements ClaimSessionI {
public claimSessionBean() {
}
@PersistenceContext(name="lab01Web")
private EntityManager em;
public void createclaimHeader(ClaimHeader claimHeader) {
System.out.println("creating clm");
em.persist(claimHeader);
}
/*
의 persistence.xml :
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="lab01Web" transaction-type="JTA">
<jta-data-source>java:comp/env/MyDB</jta-data-source>
<class>entities.BatchHeader</class>
<class>entities.ClaimHeader</class>
<properties>
<property name="openjpa.jdbc.Schema" value="APP" />
<property name="openjpa.jdbc.QuerySQLCache" value="false" />
</properties>
</persistence-unit>
</persistence>
ClaimHeader : ClaimHeader : 아래
내 세션 빈/DAO입니다 패키지 실체import java.io.Serializable; import javax.persistence. *;
/**
* The persistent class for the CLAIM_HEADER database table.
*
*/
@Entity
@Table(name="CLAIM_HEADER")
public class ClaimHeader implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(unique=true, nullable=false)
private long claimnumber;
@Column(name="FEE_CD", length=2)
private String feeCd;
getters/ setters.....
}
테스트를 위해 flush()를 추가하면 websphere 로그 또는 app 로그에 오류/예외가 없습니까? 'ClaimHeader'에 대한 코드도 유용 할 수 있습니다. – pirho
websphere 로그의 오류 : [12/14/17 10 : 20 : 49 : 971 EST] 0000009d SystemErr R 3617095 [WebContainer : 0] 정보 org.apache.bval.jsr303. ConfigurationImpl - ignoreXmlConfiguration == true – user5857902
websphere 로그에 오류 만 추가됨 : {12/14/17 10 : 20 : 49 : 971 EST} 0000009d SystemErr R 3617095 [WebContainer : 0] 정보 org.apache.bval.jsr303.ConfigurationImpl - ignoreXmlConfiguration == true - – user5857902