Bugs item #516835, was opened at 2002-02-13 00:27
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=516835&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
Status: Open
Resolution: Accepted
Priority: 5
Submitted By: Georg Schmid (giorgio42)
Assigned to: Dain Sundstrom (dsundstrom)
Summary: pk constraint name too long

Initial Comment:

RH 20020212, W2K, Oracle 8.1.7.

Supplying a broken jbosscmp-jdbc.xml reveals,
that the CMP pk constraint name generation code does
not take into account the maximum identifier length
allowed by the underlying data source.

It seems as if EB and pk field names are simply
concatenated without looking at the length of the
generated identifier.


Georg

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

>Comment By: Georg Schmid (giorgio42)
Date: 2002-02-27 09:39

Message:
Logged In: YES 
user_id=437570


I just tried the max. alias setting.
Now the alias names are cut off after 30 characters.

Now I get an InvalidColumnName from Oracle.
When you have a relation-table-mapping and the
table name has been specified in the jbosscmp-jdbc.xml
it might be possible to use that table name? 

(Puts the burden to specify a correct name on the user).

Georg

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

Comment By: Georg Schmid (giorgio42)
Date: 2002-02-27 09:25

Message:
Logged In: YES 
user_id=437570


Sorry that I have to pester you with this in the face
of all the value you've just added to JBoss.

You can get the limit using the JDBC database metadata API
(java.sql.DatabaseMetaData).

Using the DbVisualizer tool from www.minq.se
(get it, it's good), that uses this API I get a host of 
limits:

getMaxBinaryLiteralLength       1000
getMaxCharLiteralLength 2000
getMaxColumnNameLength  30
getMaxColumnsInGroupBy  0
getMaxColumnsInIndex    32
getMaxColumnsInOrderBy  0
getMaxColumnsInSelect   0
getMaxColumnsInTable    1000
getMaxConnections       0
getMaxCursorNameLength  0
getMaxIndexLength       0
getMaxSchemaNameLength  30
getMaxProcedureNameLength       30
getMaxCatalogNameLength 0
getMaxRowSize   2000
doesMaxRowSizeIncludeBlobs      true
getMaxStatementLength   65535
getMaxStatements        0
getMaxTableNameLength   30
getMaxTablesInSelect    0
getMaxUserNameLength    30

So:
getMaxColumnNameLength=30 and
getMaxSchemaNameLength=30 and
getMaxTableNameLength=30
seem to be relevant here.


The getMaxStatementLength=65535 reminds me of another catch
with the preload selects (where (id=?) or (id=?) or
... until max(page-size times, rows-in-table)) I guess.

Georg

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

Comment By: Georg Schmid (giorgio42)
Date: 2002-02-27 08:15

Message:
Logged In: YES 
user_id=437570


I already know several places where I can
put the great new EJB-QL compiler and its "order by" 
capability to good use :), but in the meantime...

>From the following custom finder query (two String params):

        <ejb-ql>
          select object(schedule)
            from ScheduleTable schedule,
                 IN(schedule.equipments) equipments
           where schedule.maintenance.id = ?1
             and equipments.id = ?2
        </ejb-ql>

the following SELECT is generated (slightly formatted):

SELECT t0_schedule.ID
  FROM SCHEDULE t0_schedule,
  EQUIPMENT t2_equipments,
  MAINTENANCE t1_schedule_maintenance
 WHERE t1_schedule_maintenance.ID = ?
   AND t2_equipments.ID = ?
   AND (t0_schedule.FK_MAINTENANCE_ID=t1_schedule_maintenance.ID
        AND
t0_schedule.ID=t3_schedule_equipments_RELATION_.FK_SCHEDULE_ID
        AND
t2_equipments.ID=t3_schedule_equipments_RELATION_.FK_EQUIPMENT_ID)

Two problems:

- the identifier 
t3_schedule_equipments_RELATION_ is too long (Oracle error
ORA-00972). 
- this identifier is missing in the FROM clause (that's
a different bug).

This query worked until yesterday.

So if this alias name is shortened to something Oracle
is able to handle, the semantic checker will complain.

I guess, in general the length of relationship table alias 
name should be less than
 max(length(ATableName), length(BTableName)) 
(or <= max(length(A_AbstractSchema),length(B_AbstractSchema)))
to be on the safe side.

Georg


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

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

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to