Questions tagged [toplink-essentials]

The Java Persistence API Implementation at GlassFish

For more info, see the official TopLink site

46 questions
32
votes
9 answers

Setting a parameter as a list for an IN expression

Whenever I try to set a list as a parameter for use in an IN expression I get an Illegal argument exception. Various posts on the internet seem to indicate that this is possible, but it's certainly not working for me. I'm using Glassfish V2.1 with…
Loren_
  • 2,597
  • 3
  • 20
  • 29
20
votes
5 answers

Are entities cached in jpa by default?

I add entity to my database and it works fine. But when i retrieve the List, i get the old entity, the new entities i add are not shown until i undeploy the application and redeploy it again. This means are my entities cached by default? But, I…
TCM
  • 16,780
  • 43
  • 156
  • 254
17
votes
1 answer

JPA - saving changes without persist() invoked

We are using Toplink implementation of JPA + Spring + EJB. In one of our EJBs we have something like this: public void updateUser(long userId, String newName){ User u = em.get(User.class, userId); u.setName(newName); // no persist is…
anthony
  • 283
  • 1
  • 3
  • 12
7
votes
3 answers

Why JPA persist() does not generated auto-increment primary ID?

I'm using JPA toplink-essential and SQL Server 2008 My goal is to get auto-increment primary key value of the data that is going to be inserted into the table. I know in JDBC, there is getInsertedId() like method that give you the id of…
Meow
  • 18,371
  • 52
  • 136
  • 180
6
votes
3 answers

JPA inserts slow with an object graph

I'm trying to do a cascading save on a large object graph using JPA. For example (my object graph is a little bigger but close enough): @Entity @Table(name="a") public class A { private long id; @OneToMany(cascade = CascadeType.ALL, mappedBy =…
user364939
  • 233
  • 1
  • 10
5
votes
1 answer

(JPA/Toplink) Network error IOException: Address already in use: connect

I have a JPA project which used to work. This month, I have added some data in my database. When I run the usual job (I used to run on preceeding months), I get this error: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs…
Jean N.T.
  • 73
  • 1
  • 5
5
votes
4 answers

EJB3 - @Column(insertable="false") question

I'm building a J2SE application with EJB3 and an Oracle Express Edition DB. My problem is like that - I set an EntityBean in my project which matches a table in the DB. The table contains a column which is not nullable and has a default value. All I…
WhiteTigerK
  • 51
  • 1
  • 2
4
votes
1 answer

JPA optimistic lock version handling - version value should be carried onto client side or?

I'm wondering how to handle optimistic lock version property in entity class using JPA (toplink essentials) from server to client and vice versa. Here is the scenario. From browser user send request to the server asking for individual user info to…
Meow
  • 18,371
  • 52
  • 136
  • 180
4
votes
2 answers

Error While acquiring Client session in TopLink

I am facing a peculiar issue. Below is the stack trace of what error i am getting.Please help. Exception [TOPLINK-7001] (Oracle TopLink - 11g Release 1 (11.1.1.1.0) (Build 090527)): oracle.toplink.exceptions.ValidationException Exception…
M.J.
  • 16,266
  • 28
  • 75
  • 97
3
votes
3 answers

How to catch OptimisticLockException in servlet level?

I'm using JPA toplink-essential, building REST web app. I have a servlet that find one entity and delete it. Below code I thought I could catch optimistic lock exception in servlet level but its not! Instead RollbackException is thrown, and that's…
Meow
  • 18,371
  • 52
  • 136
  • 180
3
votes
2 answers

JPA: Does EntityManager.find() always return the same object reference for the same key?

I've got an integration test of a DAO in which I use a shared EntityManager (via Spring, using SharedEntityManagerCreator). The test class is marked as @Transactional, as is the DAO method under test. In both the test class and the DAO I'm…
Conan
  • 2,288
  • 1
  • 28
  • 42
2
votes
3 answers

How to reestablish a JDBC connection after a timeout?

I have a long-running method which executes a large number of native SQL queries through the EntityManager (TopLink Essentials). Each query takes only milliseconds to run, but there are many thousands of them. This happens within a single EJB…
Dmitry Chornyi
  • 1,821
  • 4
  • 25
  • 33
2
votes
1 answer

JPA: NamedQuery of name: not found

I'm using Netbeans 6.9.1 and TopLink Essentials for the JPA. I had followed the necessary steps for JPA connection. Yet when I execute a named query in a particular entity. This exception always return to me NamedQuery of name: [the query name] not…
Cyril Horad
  • 1,555
  • 3
  • 23
  • 35
2
votes
1 answer

PersistenceException with Umlaut in path

I experienced an odd behavior with a java desktop application that uses Toplink essentials as persistence provider. I have a single directory containing all I need for my application: a jar, a lib folder and a JavaDB database. The whole directory is…
Matt Handy
  • 29,855
  • 2
  • 89
  • 112
2
votes
2 answers

java web application caching data, how to stop it so that the data is not stale!

HI, I am having a problem. My (i am guessing) persistence layer is caching my results, so when i update the database from outside my application then the data is remaining stale. however, it is only caching half the time, i hope this makes sense, I…
David
  • 893
  • 3
  • 10
  • 15
1
2 3 4