-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: indivdual user access to Oracle using Hibernate
PostPosted: Thu Oct 07, 2004 9:27 am 
Newbie

Joined: Thu Oct 07, 2004 9:15 am
Posts: 5
We want to use Hibrenate as our persistence layer but we have a big question since we're all new to Hibernate.
We will have a web application where users will be identified so their access to data (oracle database) will vary according to permissions. In other words, we would like to use Hibernate using individual access so the vpd can identify who is using the DB and which rows can be accessed.

Can we use Hibernate? if so, what's the best practice for this? Help is much appreciated!

Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 9:30 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Oracle VPDs should be transparent to Hibernate. Hibernate3 has a similar feature: data filters. This enables the same functionality cross-plattform in the Java middle tier.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 9:38 am 
Newbie

Joined: Thu Oct 07, 2004 9:15 am
Posts: 5
Thanks for your response.

Just to clarify, when Hibernate opens a session, this interacts with the Oracle database on a per-user basis?
For example, if we use the session in this way, is Oracle aware of the user? how can this be set up then?

Session session =sessionFactory.openSession(); Transaction tx =session.beginTransaction();
AuctionItem item = (AuctionItem)session.get(ActionItem.class,itemId);
bid.setItem(item); item.getBids().add(bid);
tx.commit(); session.close();


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 07, 2004 9:40 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
There are some ways to do this. You can implement your own ConnectionProvider, TransactionFactory, etc. I've heard of others using Oracle VPDs with Hibernate, but never tried it myself.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 22, 2005 6:27 am 
Beginner
Beginner

Joined: Mon Sep 01, 2003 10:52 am
Posts: 23
Location: UK
HI

We are also looking into using Hibernate alongside ORACLE VPD and would like to know of anyone who has done this.

Can anyone point us in the right direction please.


cheers Paul


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 22, 2005 11:55 am 
Beginner
Beginner

Joined: Tue Nov 02, 2004 1:34 pm
Posts: 45
Typically a web app has one connection to the database and all the users of a web app are seen by the database as one user. Not want you want.

However, there is no rule that web apps have only one connection. You could set up individual connections, one for each user, with that user's login/password...and in your code, whenever you connect, you connect using that user's connection -- then the database knows each individual.

There may be better ways of doing this...but this should work.

Lee


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2005 4:34 am 
Beginner
Beginner

Joined: Mon Sep 01, 2003 10:52 am
Posts: 23
Location: UK
We are currently using a connection pool and are trying to obtain a connection from the pool and associate it with a specific user using

conn = hibernateSession.connection();

(oracleConnection)conn.setClientIdentifier(clientId).

Still early days yet, but we are trying to find reference material on how to do this using SPring Hibernate and Oracle 9i VPD.

Paul


Top
 Profile  
 
 Post subject: VPD and Oracle
PostPosted: Thu Mar 17, 2005 6:37 pm 
Newbie

Joined: Thu Mar 17, 2005 6:32 pm
Posts: 1
Just found this old topic in the archives. Have we found any documentation or Howto's yet?


thanks,
Sanjay


Top
 Profile  
 
 Post subject: Have you let VPD work with Hibernate ?
PostPosted: Tue Dec 13, 2005 8:52 am 
Newbie

Joined: Tue Dec 13, 2005 7:48 am
Posts: 1
Hello Paul,

Just wonder if you have let Oracle VPD work with Hibernate.
I have the same problem you had-try to use Oracle VPD with hibernate.

Cheers

Charles

Paul wrote:
We are currently using a connection pool and are trying to obtain a connection from the pool and associate it with a specific user using

conn = hibernateSession.connection();

(oracleConnection)conn.setClientIdentifier(clientId).

Still early days yet, but we are trying to find reference material on how to do this using SPring Hibernate and Oracle 9i VPD.

Paul


Top
 Profile  
 
 Post subject: Data Filters Docs
PostPosted: Wed Dec 13, 2006 7:47 pm 
Newbie

Joined: Fri Jun 03, 2005 4:23 pm
Posts: 5
Where is you documentation for data filters????? I cannot find it anywhere?

Thanks,
Angela


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.