I guess that while calling "regular" JDBC methods the schema name is implicit, but in 
the various methods in DatabaseMetadata it's not. -Probably because you might be 
logged in as one user/schema, but still might want to look at the structure 
(=metadata) for other schemas. So schema name is (and this is a guess) _not_ implicit 
when dealing with the DatabaseMetadata methods. -And that's what Middlegen does. -And 
that's why it's required on Oracle (and maybe other databases too) when Middlegen is 
run. The JDBC spec is so fuzzy it doesn't say anything about this.

However, the EJB container calls "regular" JDBC methods, and the schema name is no 
longer required (because it is implicit as you say) - at least in most cases. -But 
IIRC, someone requested a while ago that the schema name be present _also_ in the 
deployment descriptors, and therefore in the @ejb.persistence tags that Middlegen 
generates.

It all boils down to that we need an option on the cmp20 plugin like 
useSchemaPrefix="true|false" (with default to false) that decides whether the tags 
should be generated with or without the schema prefix.

-And that's what Scott has a patch for (I hope).

P.S. could you please turn off HTML email? That makes it easier to inline comments 
when answering.

Cheers,
Aslak
 
 -----Original Message-----
From: Rod Macpherson [mailto:[EMAIL PROTECTED]]
Sent: 4. desember 2002 01:22
To: Aslak Hellesøy; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [Middlegen-user] mssql 2000 jdbc driver


The schema is normally implicit when logging in as an oracle user so it is surprising 
that a schema name is required in middlegen but it is definitely required.  The 
problem is that when you deploy under JBoss the schema qualifier causes a failure. I 
solved this by filtering jbosscmp-jdbc.xml to remove the schema prefix on table-name 
elements and that worked fine. So you need the schema to generate the code but you 
have to filter it out before you deploy to JBoss. That seems to be the situation with 
oracle/jboss at least. Sounds like a possible JBoss error? 

-----Original Message----- 
From: Aslak Hellesøy [mailto:[EMAIL PROTECTED]] 
Sent: Tue 12/3/2002 3:32 PM 
To: [EMAIL PROTECTED]; [EMAIL PROTECTED] 
Cc: 
Subject: RE: [Middlegen-user] mssql 2000 jdbc driver





> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: 3. desember 2002 23:46
> To: [EMAIL PROTECTED]
> Subject: [Middlegen-user] mssql 2000 jdbc driver
>
>
> Hi,
>
> I have a small problem with middlegen when I use the mssql 2000 jdbc
> driver.  It puts the schema name in front of the table name in the
> @ejb.persistence tag.  Instead of @ejb.persistence table-name="contacts",
> I get @ejb.persistence table-name="dbo.contacts".  This results in syntax
> errors which abort the deployment.
>

We added the schema name because some ejb container (or was it jdbc driver?)
required the schema name to _be_ present.

> I added an option to middlegen to take care of the problem but I was
> wondering if there was a way to fix it without a source change.  I didn't

Currently there is no such option. Your patch to make this optional is most
welcome.

> see one but I haven't used middlegen very long so I could have easily
> missed something.  If it turns out that the change is needed,  I'll submit
> it as a patch.
>
> Thanks,
> Scott
>

Cheers,
Aslak

>
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Microsoft Visual Studio.NET
> comprehensive development tool, built to increase your
> productivity. Try a free online hosted session at:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
> _______________________________________________
> middlegen-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/middlegen-user



-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
middlegen-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/middlegen-user



-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
middlegen-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Reply via email to