Hi All,
I am new to Eclipse Link. I have project that consumes Eclipse link in web logic server. My problem is when ever i update any row value using backed it is not getting reflected for that i have to restart my server.
Here is my persistence.xml file
<persistence-unit name="BasePersistenceUnit" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/CTH_DS</jta-data-source>
<class>org.test.partyrequest.model.dataobject.RqstTrc</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-server" value="WebLogic_10" />
<!-- Logging level is set to INFO, Need to change in Production -->
<property name="eclipselink.logging.level" value="FINE" />
<property name="eclipselink.persistence-context.flush-mode" value="COMMIT" />
<property name="eclipselink.persistence-context.close-on-commit" value="true" />
<property name="eclipselink.cache.shared.default" value="false" />
</properties>
</persistence-unit>
My Entity class
@Entity
@Table(name = "BUSN_APPLC")
@NamedQueries({
@NamedQuery(name = "fetchBusinessApplications", query = "SELECT busnApps FROM BusnApplc busnApps "),
@NamedQuery(name = "fetchBusinessApplicationByName", query = "SELECT busnApps FROM BusnApplc busnApps "
+ "WHERE busnApps.busnApplcNm = :busnApplc ")
})
public class BusnApplc implements Serializable {
private static final long serialVersionUID = -2034912319094137940L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "BUSN_APPLC_BUSNAPPLCID_GENERATOR")
@SequenceGenerator(name = "BUSN_APPLC_BUSNAPPLCID_GENERATOR", allocationSize = 1, sequenceName = "BUSN_APPLC_SEQ")
@Column(name = "BUSN_APPLC_ID")
private Long busnApplcId;
@Column(name = "BUSN_APPLC_DSCR")
private String busnApplcDscr;
@Column(name = "BUSN_APPLC_NM")
private String busnApplcNm;
// bi-directional many-to-one association to PrtyRqst
@OneToMany(mappedBy = "busnApplc", fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
private List<PrtyRqst> prtyRqsts;
// bi-directional many-to-one association to PrtyRqstHist
@OneToMany(mappedBy = "busnApplc", fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
private List<PrtyRqstHist> prtyRqstHists;
public Long getBusnApplcId() {
return this.busnApplcId;
}
Here is my DAO IMPL class where i am using entity manager
@Transactional(readOnly = true, propagation=Propagation.REQUIRED)
private PartyRequestBO createRequest(PartyRequestBO partyRequestBO, boolean isParent) throws RuntimeException {
if (log.isDebugEnabled()) {
log.debug("Enter: PartyRequestsDAOImpl:createRequest()");
}
partyRequestBO.setOrchestrationID(generateOrchestrationId());
PrtyRqst prtyRqstDO = PartyRequestEntityMapper.partyRequestMapper(partyRequestBO, isParent, true);
try {
this.persist(prtyRqstDO);
partyRequestBO.setRequestIdentifier(prtyRqstDO.getPrtyRqstId());
} catch (Exception e) {
if(log.isDebugEnabled()) {
log.debug("PartyRequestsDAOImpl:createRequest : " + PartyRequestConstants.UNABLE_TO_INSERT, e);
}
throw new PartyRequestDataException(PartyRequestConstants.UNABLE_TO_INSERT, e);
}
if (log.isDebugEnabled()) {
log.debug("Exit: PartyRequestsDAOImpl:createRequest()");
}
return partyRequestBO;
}
@Transactional(readOnly = true, propagation=Propagation.REQUIRED)
public void persist(T entity) {
if (log.isDebugEnabled()) {
log.debug("Enter: BaseDAO:persist() : " + entity);
}
this.getEntityManager().persist(entity);
if (log.isDebugEnabled()) {
log.debug("Exit: BaseDAO:persist()");
}
}
can any tell how can i get the updated value with out restarting the server.
Thank you in advance.
Vijay