views:

246

answers:

1

We are creating a small application that will be deployed to very limited machines. They have only 256mb of RAM.

I would like to use JPA as it simplifies the code and removes the need for JDBC ResultSet code. However, will the overhead of JPA on such small machines be a factor? I am thinking of using Toplink at the moment, which comes in a 2.5mb JAR file.

We only have a limited number of tables, so the JDBC code won't be too much trouble. But JPA makes the code so nice.

Cheers.

+1  A: 

JPA/ORM performance at runtime will always be greater than or equal to JDBC, since they're both based on JDBC.

As you've noted, the big lift you get from JPA/ORM is at development time.

I would like to use JPA as it simplifies the code and removes the need for JDBC ResultSet code.

I'm not sure that I understand this statement. JPA will be using a ResultSet behind the scenes; you just won't be writing it. The mapping from ResultSet to objects is encapsulated in XML or annotations.

If you're truly memory bound, you might have to pass on JPA and hand code the JDBC.

You might look at Spring JDBC in that case, because it's got a very nice design for JDBC support that makes it pretty simple.

256MB of RAM? You'll have a hard time using any 3rd party libraries.

duffymo
'I would like to use JPA as it simplifies the code and removes the need for JDBC ResultSet code.' - That's what I meant, that we won't need to write it. JPA is awesome in that it can just return the collections. As much as I dislike it, I think we'll have to go with JDBC. Thanks.
StillLearning