Displaying posts filed under

database

Dec
6
2010

OpenJPA Auto Detach Configuration and Memory Issues

When I was doing some work with OpenJPA, I found there is a possible memory leaking issue when OpenJPA is used for data access without the proper configuration of the parameter of auto detach (openjpa.AutoDetach).
The scenario that the memory issue may happen:

One EntityManagerFactory and One EntityManager are used throughout the whole session;
The session contains [...]

Mar
24
2010

Remember to Clear Entity Manager if Entities No Longer Used

Recently  a lesson was learned about the proper use of Java JPA to persist a large number of records into database in a batch process.

Some times it is necessary to load the records line by line from a large file and insert into the database table. There can be several ways to do this:

Use the [...]

Oct
14
2009

Use OpenJPA with MySQL: Some Tips

OpenJPA is an implementation of the JPA (Java Persistence API) standards. Initially, I used OpenJPA with Derby which is also known as JavaDB. It works well. However, when i tried to use MySQL as the backend database, I encountered a few issues. Here are a few small tips i would like to share when using [...]

Dec
5
2008

derby db connecting problem (using ij)

derby db connecting problem (using ij)
This problem happened to me when i tried the apache derby database (now it’s also called java db, part of jdk 6).
Trying the following command in ij (the bundled simple console) just gave me an error like this “ERROR: Unable to establish connection”:
ij> connect “jdbc:derby://localhost/firstdb;create=true”;
It’s annoying, because i didn’t know [...]