eclipselink

EclipseLink ignores strategy for id generation - PostgreSQL

泄露秘密 提交于 2019-12-11 22:54:56
问题 Please look at my apps configuration. As it is marked in the answer, I have changed target-database to "Database" due to the bug of EclipseLink. I have @GeneratedValue(strategy=GenerationType.IDENTITY) on my entities id. In the database this column is of serial type. When I try to save a new object to the database I get following log: 2015-11-08T23:37:20.748+0100|Finer: client acquired: 133317409 2015-11-08T23:37:20.760+0100|Finer: TX binding to tx mgr, status=MARKED_ROLLBACK 2015-11-08T23:37

How do I resolve mssql resetting connections

匆匆过客 提交于 2019-12-11 20:46:16
问题 I keep getting this error randomly when I test an application with mssql and don't have an idea of what I can do to correct the issue. Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset ClientConnectionId:a2fb508d-0e8e-48b0-92ed-2d1f262b4db1 Error Code: 0 My setup consists of Eclipselink as the ORM sqljdbc v4.1 sql

eclipselink 2 OneToMany with one association table how to delete from one side

别说谁变了你拦得住时间么 提交于 2019-12-11 20:40:13
问题 i have the following entity relationship: SideA: @Entity @Table(name = "SideA") public class SideA { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @CascadeOnDelete @OneToMany(fetch = FetchType.LAZY, mappedBy = "sideA", cascade=CascadeType.ALL) private List<ABAssociation> association = new ArrayList<ABAssociation>(); } Side B: @Entity @Table(name = "SideB") public class SideB { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; @CascadeOnDelete

JPA stops working after redeploy in glassfish

大兔子大兔子 提交于 2019-12-11 18:23:32
问题 Using oracle xe with glassfish and eclipselink. Problems with persisting objects arise. After fresh restart of glassfish app works ok. If app is recompiled and redeployed via admin interface. Persisting objects stops working. The error is: Internal Exception: java.sql.SQLException: ORA-17041: (no message for error) 1 Error Code: 17041 What am I doing wrong? EDIT: Pasted logs http://pastebin.com/qC01ztkx 回答1: Found the problem. I had a reference to ojdbc6.jar in my app. I have removed the

Commit transaction after exception - undo setRollbackOnly

℡╲_俬逩灬. 提交于 2019-12-11 18:18:28
问题 Within my method with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) there can sometimes happen a org.eclipse.persistence.exceptions.DatabaseException due to an SQLException . I catch this exception and handle the situation by another database query. However, this query does not get through, as due to the exception, setRollbackOnly is automatically set and I am unable to commit the transaction any more at this point. In Java SE I'd do an explicit manager.getTransaction()

Do I need to include EclipseLink modelgen package in my Maven dependencies?

怎甘沉沦 提交于 2019-12-11 17:14:33
问题 I am using Netbeans 7.1 to write a Maven-built JSF 2.0 web application. The server is GlassFish 3.1, and EclipseLink as a JPA 2.0 provider. When I do a "clean and build" of the project, all the generated sources for the JPA meta-model go away and don't come back. So Netbeans sees piles of undefined symbols. Red dots everywhere. The odd thing is, if I run the project, the meta-model somehow gets generated then, and eventually finds its way back to the generated-sources directory that the Maven

Eclipslink - Unknown entity type

亡梦爱人 提交于 2019-12-11 17:09:24
问题 I am using some entities generated by Netbeans. After generation I tested them and they were working fine. So then I had to move to my next step and combine those with my JAXB objects. After combining with the JAXB objects I am able to unmarshall my XML stream with no problem. But when I try to use any of those classes for anything entity related I get some errors. I am back at the testing phase again now and here is what I have. I have a test class just running from a simple main method. The

Eclipselink merge/persist with joined objects

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:13:33
问题 I have two entities, A and B. When I merge A, I want B to be merged as well - so I never do operations on B, just always operations on A. The B object will be accessible via the A object, but not vice versa (if possible). A and B share the same primary key field, that is, the primary key field of B is a foreign key to the primary key of A. However, I've finally got it to the point where the INSERT queries are in the correct order, but because it's not binding the ID in query parameters, it's

JPA 2 Criteria API - Exception converting JPQL to Criteria API query with Eclipselink

筅森魡賤 提交于 2019-12-11 15:02:47
问题 I'm having trouble converting a JPA query to the use the Criteria API I have the following query that attempts to find a ServiceUser matching a passed address parameter. ServiceUser is an abstract entity with concrete subclasses Child and Adult. I'm using the joined inheritance strategy on the ServiceUser class. Everything works fine when I call this method. public Set<T> findByAddress(Address address) { Query query = manager.createQuery("SELECT distinct s FROM ServiceUser AS s JOIN s

MOXy marshal List<?> how to avoid that it shows the type in json results?

情到浓时终转凉″ 提交于 2019-12-11 14:09:48
问题 If I have to marshal a List<?> how to avoid that it shows the type? So the result of a marshalling List<?> is [{"type" : "person","id":"1"},{"type" : "person","id":"2"}] } and it give me also the type="Person" in the JSON results! How could I avoid that it shows me the type? Thank you 回答1: I haven't been able to reproduce the issue that you are seeing. Below is what I have tried. Domain Model (Person) package forum16966861; public class Person { private int id; private String name; public int