persistence

Updated data (in Database) is not visible via JPA/Eclipselink

瘦欲@ 提交于 2019-12-02 01:28:37
问题 I have Oracle DB and Java project which is connected to the DB using JPA/Eclipselink. The problem is that when some data updated in the database (manually using Oracle SQL developer), this data is not visible via JPA, only old values. What can cause such problems? 回答1: Please try em.refresh() JPA's EntityManager will be unaware of any changes you made outside its transaction till it reloads the data. Above command will make it reload the data. If it is a List (populated using select), then

playframework - package javax.persistence does not exist

允我心安 提交于 2019-12-02 01:09:42
问题 I have Issue with using database I was going with this tutorial http://vimeo.com/58969923# (one from playframework.com page) in the model: play-2.2.1/jcirs/app/models/MedicalIncident.java public class MedicalIncident extends Model{} I am trying to use Entity. For that I have to import: javax.persistence.* and play.db.ebean.* but none of them can be found. The error is package javax.persistence does not exist What should I do? Use any other database engine? Or should download some dependency.

WCF data persistence between sessions

柔情痞子 提交于 2019-12-01 22:48:07
We are developing a WCF based system. In the process we are trying to lock some data from being modified by more than one users. So we decided to have a data structure that will contain the necessary information for the locking logic to execute (by for example storing the ID of the locked objects) The problem we are having is persisting that data between sessions. Is there anyway we can avoid executing expensive database calls? I am not sure how can we do that in WCF since it can only persist data (in memory) during an open session. Static members of the service implementing class are shared

playframework - package javax.persistence does not exist

穿精又带淫゛_ 提交于 2019-12-01 21:39:00
I have Issue with using database I was going with this tutorial http://vimeo.com/58969923# (one from playframework.com page) in the model: play-2.2.1/jcirs/app/models/MedicalIncident.java public class MedicalIncident extends Model{} I am trying to use Entity. For that I have to import: javax.persistence.* and play.db.ebean.* but none of them can be found. The error is package javax.persistence does not exist What should I do? Use any other database engine? Or should download some dependency. I would like to go with playframework best way. Please help. My configuration application.conf: db

Where do I set TransactionOptions with JDO / Google App Engine?

眉间皱痕 提交于 2019-12-01 19:17:43
问题 I use JDO within GAE to batch persist objects using the following method: public void makePersistent(PersistenceManager pm, List<Regeling> makePersistent) { Transaction tx = pm.currentTransaction(); try { // Start the transaction tx.begin(); // Persist to the datastore // pm.makePersistentAll(makePersistent); for (int i = 0; i < makePersistent.size(); i += BATCH_SIZE) { int last = i + BATCH_SIZE; last = last > makePersistent.size() ? makePersistent.size() : last; pm.makePersistentAll

Where do I set TransactionOptions with JDO / Google App Engine?

試著忘記壹切 提交于 2019-12-01 18:22:16
I use JDO within GAE to batch persist objects using the following method: public void makePersistent(PersistenceManager pm, List<Regeling> makePersistent) { Transaction tx = pm.currentTransaction(); try { // Start the transaction tx.begin(); // Persist to the datastore // pm.makePersistentAll(makePersistent); for (int i = 0; i < makePersistent.size(); i += BATCH_SIZE) { int last = i + BATCH_SIZE; last = last > makePersistent.size() ? makePersistent.size() : last; pm.makePersistentAll(makePersistent.subList(i, last)); pm.flush(); System.out.println("Made "+last+" items persistent."); } //

IdentityServer4 - How to store refresh token into database using mysql.data?

我的梦境 提交于 2019-12-01 17:26:07
问题 I'm new at IdentityServer4. I read I need to implement an IPersistedGrantStore to store refresh tokens into a table like PersistedGrants in my database. IdentityServer logs is the following when my native app ask for a new access token: "refresh_token" grant with value: "{value}" not found in store . That's because I'm using in-memory version of the persisted grant store. So I need to store refresh token in a PersistedGrant table. Therefore in my startup.cs I added the following line: builder

Persistence @Column nullable = false can insert null

蓝咒 提交于 2019-12-01 17:20:25
I want to do this column can´t be null but when I insert in database one register values null this allows me inserted. I read documentation and I don´t know why doesn´t work. @Column(name="QWECOD", nullable = false) private String qwe; THX UPDATE: I´m using Toplink and java org.eclipse.persistence.eclipselink:2.4.2 . Andreas Aumayr I think nullable is used if you generate the schema, using the implementation of the entitymanager. I don't know whether it is / has to be validated while persisting an entity as well. Maybe it helps if you use the @NotNull annotation, but this is NOT plain JPA. It

Persistence @Column nullable = false can insert null

。_饼干妹妹 提交于 2019-12-01 17:05:24
问题 I want to do this column can´t be null but when I insert in database one register values null this allows me inserted. I read documentation and I don´t know why doesn´t work. @Column(name="QWECOD", nullable = false) private String qwe; THX UPDATE: I´m using Toplink and java org.eclipse.persistence.eclipselink:2.4.2 . 回答1: I think nullable is used if you generate the schema, using the implementation of the entitymanager. I don't know whether it is / has to be validated while persisting an

Services with missing/unavailable dependencies

大城市里の小女人 提交于 2019-12-01 17:04:03
问题 Any idea why I'm getting this error: JBAS014775: New missing/unsatisfied dependencies: service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.jboss/datasources/UserDS] ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) `{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.data-source.jboss/datasources/UserDSjboss