Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » How to refresh the entities with out re starting the server(How to refresh the entities with out re starting the server)
How to refresh the entities with out re starting the server [message #1053061] Thu, 02 May 2013 09:37 Go to next message
Vijay Kumar is currently offline Vijay KumarFriend
Messages: 6
Registered: May 2013
Junior Member
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">

			<property name="" 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" /> 		

My Entity class

@Table(name = "BUSN_APPLC")
	@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;
	@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()");
		PrtyRqst prtyRqstDO = PartyRequestEntityMapper.partyRequestMapper(partyRequestBO, isParent, true);
		try {
		} 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);
		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.
Re: How to refresh the entities with out re starting the server [message #1053275 is a reply to message #1053061] Fri, 03 May 2013 13:47 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1294
Registered: July 2009
Senior Member
This was asked here with some suggestions provided:

what is needed though is information on how you are reading the entity and seeing stale data. If you are getting a new EM and have disabled the shared cache, it should simply be a matter of re reading the entity, giving you a managed instance that reflects the data from the database. You might also want to share what is stale and how it was changed, as there maybe a better option than turning the shared cache off to get that data.

[Updated on: Fri, 03 May 2013 13:48]

Report message to a moderator

Previous Topic:Complex Key: Multiple writable mappings exist;
Next Topic:Loading an XML file with SDO
Goto Forum:

Current Time: Fri Apr 20 03:20:30 GMT 2018

Powered by FUDForum. Page generated in 0.02700 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software