Bugs item #661335, was opened at 2003-01-02 14:10
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=661335&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter Luttrell (objec)
Assigned to: Nobody/Anonymous (nobody)
Summary: JBoss links ejbs to tables in wrong tablespace

Initial Comment:
JBoss 3.0.2
Oracle8.1.7

I have 2 oracle users:
user1 has 3 tables in it's default tablespace called A, B 
and C (which i created with one version of the 
deployment).

ok, so i add another datasource pointing at the same db 
with user2 as the login. It has it's own tablespace and 
cannot write to user1's tablespace.

I then have a deployment (another set of apps) that 
deploys 5 enity beans that point at tables A, B, C, D 
and E. I'm reusing A, B and C.

When I deploy, JBoss creates tables D and E in user2's 
tablespace, but does not create table A, B or C.

Then when i try to use the beans and write to bean/table 
A, JBoss blows up. with this error: 
java.sql.SQLException: ORA-00942: table or view does 
not exist

I'm thinking that something is not quite write with the 
code that creates the tables, in specific the code that 
determines if it should create the table.


If we create public synanins to user1's tables, then 
everything works fine, but this is not what i would like. I 
would like new tables created in user2's tablespace.

----------------------------------------------------------------------

Comment By: Jeremy Boynes (jboynes)
Date: 2003-01-02 16:21

Message:
Logged In: YES 
user_id=378919

This happens because user2 has access to user1's tables even
though they are in a different schema. This is probably due
to an explicit grant or because user2 has the
select_any_table role (e.g. it is a DBA account). As a
result a row is returned by getTables(catalog, null,
tableName) making JBoss believe the table exists.

JBoss can't handle this conflict without knowledge on how
partial identifiers (e.g. "A") are resolved by the
underlying database. Oracle's rules here are quite different
to a database e.g. SQLServer that uses the full
catalog.schema.object convention. This makes a general
solution complex and means resolution probably has to wait
for database pluggability.

In the mean time, I would highly recommend reducing the
roles granted to your user2 account - granting just
connect,resource (or better, more specific rights) will work
around this problem and eliminate a lot of the potential
security risks. Alternatively, creating the tables
explicitly (which a DBA would typically do, especially in
production, right?) and turning off automatic <create-table>
would work.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=661335&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to