toplink

Batch insert using JPA/Toplink

I have a web application that receives messages through an HTTP interface, e.g.: http://server/application?source=123&destination=234&text=hello This request contains the ID of the sender, the ID of the recipient and the text of the message. This message should be processed like: finding the matching User object for both th...

When to use Hibernate/JPA/Toplink?

Right now I'm making an extremely simple website- about 5 pages. Question is if it's overkill and worth the time to integrate some sort of database mapping solution or if it would be better to just use plain old JNDI. I'll have maybe a dozen things I need to read/write from the database. I guess I have a basic understanding of these tech...

Do I have to close() every EntityManager?

I have just started migrating my homegrown persistence framework to JPA. Given that the persistence frameworks hide a lot of the plumbing, I'm interested in knowing if NOT closing EntityManagers will create a resource leak, or if the frameworks will collect and close them for me. I intend in all places to close them, but do I HAVE to? ...

Now that I've converted my primary keys to GUIDs, how do I fix the performance?

I'm using TopLink as my ORM and MySQL as the DB. I traded my auto-increment primary keys for GUIDs for one of my tables (alright, not quite: I'm actually using a random 64 bit integer, but that's good enough for my needs). Anyway, now queries, which don't even use the key, are taking much longer. What can I do? ...

Toplink Objects not showing up under the Toplink Map node in JDeveloper

Hello, for some reason I cannot see any of the generated objects under the TL Map. See the included image (Sorry but it will not render using the community wiki software.... http://img261.imageshack.us/my.php?image=nothingundernodetn5.png ...

How to use enums with JPA

I have an existing database of a film rental system. Each film has a has a rating attribute. In SQL they used a constraint to limit the allowed values of this attribute. CONSTRAINT film_rating_check CHECK ((((((((rating)::text = ''::text) OR ((rating)::text = 'G'::text)) OR ((rating)::text = 'PG'::text)) OR ...

JPA Implementations - Which one is the best to use?

Hi all, I have made use of the following JPA implementations: Hibernate, Toplink, OpenJPA Each of them has their own strengths and weaknesses. I found Hibernate the most advanced of the three except that it mixed some of its own enhancements with JPA which made it difficult to switch out to other providers. Most importantly, its que...

OC4J - toplink 10/11 at same time ?

Can you use both toplink v. 10 (toplink essentials) and toplink v. 11 (eclipselink) at the same time within the OC4J application server? Both are different implementations of JPA. I was wondering if both implementations can be added to the OC4J application server so that bean jars can choose themselves which implementation to use. Ple...

GWT with JPA

I'm trying to build database application using GWT 1.5.3. I use JPA annotations with my objects. It seems in hosted mode GWT's RPC works fine. But when I try to compile my app using GWT-compiler I get errors like: "The import javax.persistence cannot be resolved", "Entity cannot be resolved to a type". toplink-essentials.jar is already...

Pitfalls and practical Use-Cases: Toplink, Hibernate, Eclipse Link, Ibatis ...

I worked a lot with Hibernate as my JPA implementation. In most cases it works fine! But I have also seen a lot of pitfalls: Remoting with persisted Objects is difficult, because Hibernate replaces the Java collections with its own collection implementation. So the every client must have the Hibernate .jar libraries. You have to take c...

When are two columns that look the same not the same in oracle?

I am work on a project in oracle 9i. I was having a problem with toplink 10.1.3 loading a particular row in a table. It turns out the jdbc driver that toplink is relying on is acting very funny. Perhaps someone here can help... I have a table named: crazytable. It has a column: "ver_num number(19) not null default 0". This column w...

Toplink without application server

Is it possible to use Toplink Essentials without application server, just on desktop application? ...

How to persist the same JPA Entity at multiple databases (distributed system)?

(How) is it possible to persist a JPA Entity at the databases of multiple servers without copying everything to DTOs? We have a distributed system. Some applications do have DBs for caching purposes. The JPA Provider throws an Exception in which it complains that it cannot persist a detached object. But I would like to preserve the ID ...

Oracle TopLink: Getting duplicating records mistakenly...

Hello, I am using oracle TopLink as a persistence layer with business logic implemented in java. I am using expression and expression builder class to get data from database. Problem is that in database table we donot have duplicate rows but when I query the database via ReadObjectQuery class I receive same quantity of rows as in databa...

No Persistence provider for EntityManager named ...

I have my persistence.xml with the same name, using toplink, under META-INF directory. Then I have my code calling it with... EntityManagerFactory emfdb = Persistence.createEntityManagerFactory("agisdb"); Yet, I got the following error message 2009-07-21 09:22:41,018 [main] ERROR - No Persistence provider for EntityManager named agi...

Toplink & java storing word or pdf files

I'm creating a simple page with a form. Part of the form requires uploading a pdf or word document. This will be a small file, so ideally I would like to store it in my oracle database. I'm using ejb and toplink for all of my persistence. What object should my entity class have that will hold a word or pdf file, and how do I map it to ...

List as a named parameter in JPA query using TopLink

In the following JPA query, the :fcIds named parameter needs to be a list of integer values: @NamedQuery(name = "SortTypeNWD.findByFcIds", query = "SELECT s FROM SortTypeNWD s WHERE s.sortTypeNWDPK.fcId IN (:fcIds)") Quite logically, this is what is done when the named query is called: Query findByDatesPlFcIds = em.createNamedQuery("...

JPA Entity mapping with no foreign keys available

Hi, I dont really get to work with entity beans, but they are staring at me right now. We have a couple of tables that are related to each other, but there are no foreign keys, and we cannot add any. For this question, the database cannot change, it's just not possible, but as a different solution we might create views. Anyways... I...

Toplink/java persistency mystery time sink

I have a servlet calling a session bean via a local interface. There is a 3 second pause between the last statement of the session method and the statement following that method call in the servlet. I have identified what statement in the session bean causes the extra delay upon method return, but I just have no idea why there is such ...

JPA join table with more than one entity

Hi, I have an Entity that looks like this: public class NpcTradeGood implements Serializable, Negotiabble { private static final long serialVersionUID = 1L; @EmbeddedId protected NpcTradeGoodPK npcTradeGoodPK; @JoinColumn(name = "npc_id", referencedColumnName = "id", nullable = false, insertable = false, updatable = fals...