This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to understand javax.persistence

 
E Robb
Ranch Hand
Posts: 111
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im reading struts 2 in action and trying to model my login / authentication after the portfolio login presented in the book. Unfortunately while the book uses mysql the web site I am working off of is using web services to retrieve information.

I basically have 3 questions.

1. Is javax.persistence appropriate for web services and preserving entity data or should I be using something else?

2. In struts 2.1.8 does anyone know which jar the javax is in? I am looking at Struts2InAction.war and there are no javax jars so it must be in another jar. I have tried adding spring.jar and Struts2-oval-plugin-2.1.8.1.jar to my project and I still get the dreaded "import javax.persistence cannot be resolved"

3. Im afraid I dont understand why carrying around say 4 variables in a session per user will have any less over head than having a pojo object carried around for each user. What is the advantage?


Thanks,
Earl
 
Mark Garland
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi E Robb,

I'm reading the same book, although I don't think I'm as far as you are yet.

AFAIK (and I'm willing to be corrected here), javax.persistence is for the Java Persistence API - this is the API that can be used for storing entities in a Database. It's an API that has been derived for providers to then supply implementations to (e.g. Hibernate or TopLinks), and you can use it to get a consistent API regardless of the provider, for storing your Entities in a database.

However, if you are using WebServices, then this is the wrong API. Perhaps something like AXIS2/JAX-RPC/JAX-WS might be more useful if you are trying to get information from WebServices instead?

Hope that helps,

MG
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic