• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Doubt regarding extended persistent context

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

If we obtain the EntityManager from EntityMangerFacory, then the persistent context is by default Extended.
So, we can use this technique only in stateful session beans not in MDB or stateless session beans. Am I right?
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes krishna you are right in saying that.

But you can also inject persistence context in stateful session bean using
@PersistenceContext annotation.

You can specify which kind of persistence context you want e.g. Transaction scoped or extended by specifying the same in...type property of the annotation.
e.g.

@PersistenceContext(type="extended")
EntityManager mgr;

That's one more way of doing it.

bye

nitin
 
Nitin Takale
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nitin Takale:
Yes krishna you are right in saying that.

But you can also inject persistence context in stateful session bean using
@PersistenceContext annotation.

You can specify which kind of persistence context you want e.g. Transaction scoped or extended by specifying the same in...type property of the annotation.
e.g.

@PersistenceContext(type="extended")
EntityManager mgr;

That's one more way of doing it.

bye

 
Nitin Takale
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nitin Takale:
[QB]Yes krishna you are right in saying that.

But you can also inject persistence context in stateful session bean using
@PersistenceContext annotation.

You can specify which kind of persistence context you want e.g. Transaction scoped or extended by specifying the same in...type property of the annotation.
e.g.

@PersistenceContext(type="extended")
EntityManager mgr;

That's one more way of doing it.

bye

 
Nitin Takale
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry guys for this multiple replies from my side... It happened because of improper network connectivity at my side.

I hope you will understand.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic