Bugs item #927759, was opened at 2004-04-01 14:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=927759&group_id=22866
Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: James Robinson (jlrobins_sserve)
Assigned to: Nobody/Anonymous (nobody)
Summary: Entity w/table name with schema always tries to create table
Initial Comment:
Deploying a CMP entity with the jbosscmp-jdbc.xml tag for
tablename set containaing the name of the preexisting database
schema for the table to be built in, such as:
<table-name>agency.category</table-name>
<create-table>true</create-table>
will always try to create the table, since
org.jboss.ejb.plugins.cmp.jdbc.SQLUtil's tableExists()
method does not split out the schema portion of the name into the
separate parameter mandated by DatabaseMetaData's getTables().
Calling getTables() with null for schemas:
... null means that the schema name should not be used to
narrow the search (from DriverMetaData javadoc)
yet it seems to imply that the table name portion should be the
simple name, not fully-qualified. Using Postgresql JDBC driver,
when given null for schema and "agency.category" for table name,
it always returns an empty result set, since no one table's non-
fullly-qualified name is 'agency.category' -- very different from
schema named 'agency' and table named 'category' (in
postgres's
eyes, anyway).
This causes JBoss to *always* try to create the table, causing
deployment failure on all but the first deployment.
Fix would be to sniff the passed-in table name for a '.', and split
into schema vs. table name on the period.
Patch attached to fix places in SQLUtil where getTables is called w/o
sniffing to split fully qualified table name into schema + table. The
patch is relative to SQLUtil version 1.12.4.19.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=927759&group_id=22866
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development