• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

trying to understand javax.persistence

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Let nothing stop you! Not even this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic