persistence

arquillian persistence extension doesn't work

雨燕双飞 提交于 2019-12-11 17:58:24
问题 I'm trying to get my webservice tested. This webservice uses ejb with jpa to retrieve its data. So i want to use the arquillian extension to get this done. This is my arquillian test class: @RunWith(Arquillian.class) public class PersonWebServiceIT { private PersonWebService service; @Deployment(testable = false) public static Archive<?> createDeployment() { return ShrinkWrap .create(ZipImporter.class, "test.ear") .importFrom(new File("simple-webservice-ear-1.0.0-SNAPSHOT.ear")) .as

Persistence transaction-type value?

房东的猫 提交于 2019-12-11 16:16:41
问题 I have a question about persistence.xml config parameter "transaction-type". If I set this parameter to value "RESOURCE_LOCAL", than application run fine in tomcat application server. But not in glassfish. Glassfish gave me next error: The persistence-context-ref-name [com.test.webtest.persistence.dao.jpa.AbstractGenericDaoJpa/entityManager] in module [webFrontend-1.0-SNAPSHOT] resolves to a persistence unit called [basicPersistenceUnit] which is of type RESOURCE_LOCAL. Only persistence units

How to unpersist in Sparklyr?

我的梦境 提交于 2019-12-11 16:06:26
问题 I am using Sparklyr for a project and have understood that persisting is very useful. I am using sdf_persist for this, with the following syntax (correct me if I am wrong): data_frame <- sdf_persist(data_frame) Now I am reaching a point where I have too many RDDs stored in memory, so I need to unpersist some. However I cannot seem to find the function to do this in Sparklyr . Note that I have tried: dplyr::db_drop_table(sc, "data_frame") dplyr::db_drop_table(sc, data_frame) unpersist(data

jpa, risks of using an illegal named query?

大城市里の小女人 提交于 2019-12-11 14:42:22
问题 I made a NamedQuery that works but I have multiple error markers in eclipse. Now my query might not be legal, an answer of so (see comments) told me it wasn't possible to do what I intended to do in jpa. So, since I managed to do it anyway and I don't really have a clue why it works: my question is what are the underlying risks of using this : query = "SELECT t FROM Thethread t LEFT JOIN FETCH t.threadVotes tv ON tv.user1=:currentUser ORDER BY t.datePosted DESC" Under on: JOIN FETCH

JSP application design: where to set application-wide values [duplicate]

筅森魡賤 提交于 2019-12-11 14:25:20
问题 This question already has an answer here : Using special auto start servlet to initialize on startup and share application data (1 answer) Closed 4 years ago . In a Java web application, where is the best place to set (or best mechanism to use in setting) a string (or strings) for use, application-wide, which should never change while the application is running, and most likely never after it is installed on a given server? One thing that would be key in this is that I want to be able to

Deserialization throws 'ClassNotFoundException: JavaConversions$SeqWrapper' in Scala 2.10

柔情痞子 提交于 2019-12-11 14:04:20
问题 I have a fairly complex object graph serialized out from Scala-2.9 and I need to read it into Scala-2.10. However, somewhere deep in the object graph Scala-2.10 throws: ! java.lang.ClassNotFoundException: scala.collection.JavaConversions$SeqWrapper ! at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_21] ! at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_21] ! at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_21] ! at java.net

Flush Flower database occasionally and/or exit gracefully from Docker?

家住魔仙堡 提交于 2019-12-11 13:55:49
问题 I'm running Celery Flower in Docker (see this question for details). The command ends up being: celery -A proj flower --persistent=True --db=/flower/flower I've got a persistent volume all set up on /flower . However, it looks like Flower never writes anything to its database file, even after 30 minutes of uptime (during which ~120 tasks were processed): -rw-r--r-- 1 user user 0 Mar 11 00:08 flower.bak -rw-r--r-- 1 user user 0 Mar 10 23:29 flower.dat -rw-r--r-- 1 user user 0 Mar 11 00:08

Approach for small database - iOS

人盡茶涼 提交于 2019-12-11 12:46:26
问题 i am building an app that requires me to store a number of things. I have a data object consisting of 4 to 5 BOOL variables, there could be 800 - 1000 such objects which i will need to persist. Am confused how should i program this, should i go for an sql database or Core data, since NSUserdefaults is not an option obviously. 回答1: You can easily store them in a plist as @adobels suggested. Your Class would store the BOOLs in a NSNumber and your class implements NSCoding: - (void

Storing downloaded files in Cocoa

霸气de小男生 提交于 2019-12-11 11:08:19
问题 I am developing a Cocoa application, and it requires 10.7+. So, I will gladly use the new shiny APIs. What I would like to do is download some MP3s and probably some XML data from our back-end server, and store it on the user's Mac. I would much like to store it within the "application.app" directory, alongside the initial resources that are bundled with the application. Can I do that? Store files within the application.app? If not, where is the preferred directory to store the additional

Where do I set TransactionOptions with JPA / Google App Engine? [duplicate]

二次信任 提交于 2019-12-11 10:44:23
问题 This question already has an answer here : Where do I set TransactionOptions with JDO / Google App Engine? (1 answer) Closed 4 years ago . I use JPA within GAE to persist objects. javax.persistence.PersistenceException: Illegal argument at org.datanucleus.api.jpa.NucleusJPAHelper.getJPAExceptionForNucleusException(NucleusJPAHelper.java:298) at org.datanucleus.api.jpa.JPAEntityTransaction.commit(JPAEntityTransaction.java:122) Caused by: java.lang.IllegalArgumentException: cross-group