Bugs item #927759, was opened at 2004-04-01 21:32
Message generated for change (Comment added) made by lqd
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=927759&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: James Robinson (jlrobins_sserve)
>Assigned to: Christian Riege (lqd)
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&#039;s tableExists() 
method does not split out the schema portion of the name into the 
separate parameter mandated by DatabaseMetaData&#039;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&#039;s non-
fullly-qualified name is &#039;agency.category&#039; -- very different from 
schema named &#039;agency&#039; and table named &#039;category&#039; (in 
postgres&#039;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 &#039;.&#039;, 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.



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

>Comment By: Christian Riege (lqd)
Date: 2004-04-02 11:51

Message:
Logged In: YES 
user_id=176671

I have applied your patch, thanks.

SQLUtil is a general mess though anyways ...

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

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

Reply via email to