Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to have a private variable in stateless  RSS feed

 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I know that i can�t save a state on a stateless session bean, but maybe you will sucess to find a creative way to do this.

I have a DAO that implemented as a stateless session bean.

The issue that this DAO need to work against several data bases,

So i have a factory that get the data base name and set the data base name and the right entity manager.

The client (local client) get from the factory initilize DAO, but the problem here that this is stateless session bean, so the next call in the same function to the DAO can execute against another bean (which initilize with another schema)

Does any one have a creative idea?

Thank you

ps. i want SSB in order to have supported transaction.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36396
453
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does the factory know which schema to use? Can you call the factory on each SSB call?
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the factory get schema name
look up to the dao and set the schema name (this casue to creation of entity manager and etc)

yes, i can call to the factory on each call , but it is not a good design and very verbose.
Also, this is very expensive to initilize the entity manager on each call.

i am looking for kind of creative idea.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!