Tapestry's Hibernate configuration is static; set up once at start up.
 It creates a single SessionFactory (using connection data) and
creates Hibernate Sessions as needed.

In your situation, you'd have to build your own. However, what I see
is that you'll be paying the very expensive Hibernate startup costs
*constantly* so your application performance will be terrible. You
need to refactor your approach I suspect.

For example, even though you say "each users has their own
connection", perhaps you really have 2 or 4 or 6 possible connections
across all your users.  You might be able to create a kind of
SessionFactory pool and connecting incoming requests from users to the
appropriate pool.

Or, you might find that you need to have a single schema that
incorporates application-defined user identity into tables (and
views).

I'd say build a prototype of something very simple (maybe not even
using Tapestry) that collects user/pw information and creates a
SessionFactory, creates a Session, does a query.  Try this out and see
if performance is even in the right ballpark. Work from there.

And remember; whenever you get an unreasonable "requirement" such as
this, PUSH BACK.  Half the time, the "requirement" is nonesense; just
someone up stream who doesn't understand the problem trying to "help
you" with implementation details. Find out why this exists: why do you
need to connect to databases this way?  Why Hibernate?  Etc.  Find out
the true requirement early, and the solution will likely roll out
clean and performant.


On Thu, Feb 9, 2012 at 10:54 AM, Thiago H. de Paula Figueiredo
<thiag...@gmail.com> wrote:
> On Thu, 09 Feb 2012 09:39:53 -0200, Ramprasath <jothiprasath2...@gmail.com>
> wrote:
>
>> Dear All ,
>
>
> Hi!
>
> Hibernate doesn't allow you to change a SessionFactory configuration on the
> fly. This way, you'll probably need to have a service to handle this logic
> and create or reuse SessionFactory instances. By the way, using database
> configurations coming from users is something I'd try to avoid as much as
> possible.
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to