LCB --

"LCB" wrote : You must set pk-constraint to true for mysql to fix the problem with 
creating the tables.
  | I have done it manually in the jbosscmp-jdbc.xml and it works fine.
  | 

Thanks for your reply, but it doesn't seem to be the solution.

1) From my tests, setting pk-constraint to true does not  fix the MySQL "Too big 
column length for column 'pn_name' (max = 255). Use BLOB instead". 
If I'm missing something, such as maybe a bug in xdoclet that means you have to go and 
hack the jbosscmp-jdbc.xml manually, please let me know.

2) Setting pk-constraint to true prevents the Entity from being deployed to HSQL. 

org.jboss.deployment.DeploymentException: 
  | Error while creating table NUKE_FAQ_CATEGORIES; 
  | - nested throwable: (java.sql.SQLException: 
  | Attempt to define a second primary key in statement 
  | [CREATE TABLE NUKE_FAQ_CATEGORIES (pn_name VARCHAR(256), 
  | pn_language VARCHAR(256), pn_id INTEGER NOT NULL IDENTITY, 
  | pn_parent_id INTEGER, 
  | CONSTRAINT PK_NUKE_FAQ_CATEGORIES PRIMARY KEY (pn_id))])
  |         at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:232)
  |         at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:93)
  | ...

Others have also seen this behavior...

"jae77" wrote : i know hsqldb has an issue where you can't enable the pk-constraint 
when creating the tables. 

3) So even if pk-constraint="true" fixed the MySQL column length mapping problem 
(which it doesnt seem to), it isn't portable across DBMS's.  

It would be good to get people's opinion here about how it is supposed to work; 
whether it's the HSQL or the MySQL mapping that's to blame; and where the fix needs to 
be made. 

But it is even more important to me to figure out how we can make a pure-CMP 
xdoclet-based template that works across all the DBMS's, transparently.

4) IMHO, this column length issue is not a PK-related problem...
 it seems the problem lies in the Nukes entity command (or the deeper JBoss o/r code) 
that generates the SQL phrase  for VARCHAR as 256 rather than 255: 

CREATE TABLE NUKE_FAQ_CATEGORIES (pn_name VARCHAR(256) ....
  does not work for MySQL which has a 255 limit on VARCHARs --- 
  "Too big column length for column 'pn_name' (max = 255). Use BLOB instead"

Anybody have any insights/comments on this one?

-- Howard

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3833386#3833386

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3833386


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to