eclipselink

How to set isolation level in @Transactional “READ_UNCOMMITTED”. I am using EclipseLink 2.5.1-RC1

只愿长相守 提交于 2019-12-23 12:35:37
问题 I have a requirement to start new Transaction within an ongoing Transaction so that an exception in 2nd transaction will rollback only new transaction not the old one. This I am doing by setting propagation attribute in 2nd transaction like this: @Transactional(propagation = Propagation.REQUIRES_NEW) This created a new Transaction, but the new Transaction needs to read some uncommitted data of the first transaction (dirty read), and also update that data. This I am trying to do by setting

eclipselink + @convert(json) + postgres + list property

折月煮酒 提交于 2019-12-23 11:58:22
问题 I'm using eclipselink 2.6 as a persistence provider of spring data jpa, that in my understanding, now allows you to serialize a subtree of an entity as json using the internal moxy serializer. So I'm trying to mix this to migrate from embedded element collections to a serialized json using the json datatype of postgres. I have an entity named Product, and this entity have the following mapped property: @Convert(Convert.JSON) private List<MetadataIndex> indexes=new ArrayList<MetadataIndex> ();

EclipseLink Document Doesn't Explain “session”

主宰稳场 提交于 2019-12-23 10:58:41
问题 I am trying to execute a query using EclipseLink following the crappy documentation at http://wiki.eclipse.org/Introduction_to_EclipseLink_Expressions_%28ELUG%29, but every time you need to execute an Expression it uses a variable called "session", but no where does it explain where this "session" variable comes from. I already have a persistence.xml file and I can run a javax.persistence.Query on my database, so I know the connection works, but I can't figure out where "session" comes from.

Spring @Transactional commit failures ; Deby + Eclipselink

混江龙づ霸主 提交于 2019-12-23 08:13:15
问题 The following is the spring config Date Source <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"> <property name="driverClassName" value="${rwos.dataSource.driverClassName}" /> <property name="url" value="${rwos.dataSource.url}" /> <property name="username" value="${rwos.dataSource.user}" /> <property name="password" value="${rwos.dataSource.password}" /> </bean> Entity manager config <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org

Spring @Transactional commit failures ; Deby + Eclipselink

我是研究僧i 提交于 2019-12-23 08:12:14
问题 The following is the spring config Date Source <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"> <property name="driverClassName" value="${rwos.dataSource.driverClassName}" /> <property name="url" value="${rwos.dataSource.url}" /> <property name="username" value="${rwos.dataSource.user}" /> <property name="password" value="${rwos.dataSource.password}" /> </bean> Entity manager config <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org

JPA cascade persistence with entity ElementCollection keys

时光总嘲笑我的痴心妄想 提交于 2019-12-23 07:56:09
问题 I have two JPA entities like this: @Entity class Foo { @Id private long id; // ... } @Entity class Bar { @ElementCollection(targetClass = String.class, fetch = FetchType.LAZY) @MapKeyJoinColumn(name = "foo_id", referencedColumnName = "id") @MapKeyClass(Foo.class) @Column(name = "content") @CollectionTable(name = "bar_foo_content", joinColumns = @JoinColumn(name = "bar_id", referencedColumnName = "id")) @ManyToMany(cascade = CascadeType.ALL) private Map<Foo, String> fooContent = Maps

Error on client side while calling a business method on server side returning managed entity

北慕城南 提交于 2019-12-23 05:15:58
问题 My client application is a standalone java application using Netbeans RCP. The client application connect to a remote EJB mounted on a Glassfish server. On the server side, i have a business method (i made for testing) that's supposed to take an instance of an entity (this entity is not persisted or managed yet), persist it (using the persit of the EntityManager ). Here is how this method looks like: @Override public TestLinkEntity test(TestLinkEntity c) { em.persist(c); return c; } Called

EclipseLink 2: ANT Task Error

為{幸葍}努か 提交于 2019-12-23 05:06:29
问题 I got this ANT task: <javac verbose="on" srcdir="${src.dir}" destdir="${build.dir}/${context.path}/classes" debug="${compile.debug}" debuglevel="${javac.debuglevel}" optimize="${compile.optimize}" deprecation="${javac.deprecation}" failonerror="true"> <compilerarg value="-Aeclipselink.persistencexml=${web.dir}/META-INF" compiler="javac1.6" /> <compilerarg line=" -processor org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor" /> <compilerarg line=" -proc:only" compiler=

Transaction Exception with Spring 4.0.6 + Weblogic 10.3.6 + EJB 3.0 CMT + Spring Data JPA 1.6.2 - “Error binding to externally managed transaction”

China☆狼群 提交于 2019-12-23 04:39:48
问题 I am having a weird, and hard to debug, issue using Weblogic 10.3.6, Spring 4.0.6, Spring Data JPA 1.6.2, Eclipselink (reproduced both the Weblogic embedded 2.3 version and the newest 2.5.2) and Container Managed Transactions. (I updated Weblogic to use JPA 2.0 installing the patch provided by Oracle). The issue is the following: I have a simple, stateless, EJB 3.0 in which I do use Spring Autowiring and spring-data-jpa repositories. When I do call any service exposed by the EJB, I get the

JPA createEntityManagerFactory “Unknown Source” error (non-J2EE)

限于喜欢 提交于 2019-12-23 04:25:06
问题 I can't find what's wrong: many people seem to have issues with creating a EntityManagerFactory using the PU name. But I've checked all the suggestions, and none helped so far. I'm trying to build my first JavaFX2 app. It is a small dictionary application, originally built on the Netbeans Application framework (by extending the default "Master-Detail" generated classes). It uses a SQLite db. I'm now porting it over from there to another (JavaFX2-enabled) project. I first set out to rebuild