-
1. Re: MySql ,JbossCMP2.0 and NOT NULL
tdang Aug 26, 2002 4:44 AM (in response to faisalab)Is the field telephone the primary key of the table? If not, you should set it null in the database because except the primary key Jboss does not allow other keys not null.
Hope it helps. -
2. Re: MySql ,JbossCMP2.0 and NOT NULL
faisalab Aug 26, 2002 1:34 PM (in response to faisalab)Thanks for the reply
This is the rest of the error I am getting :
***** I changed th primary key to familyName ***********
Executing SQL: SELECT COUNT(*) FROM contactinfoejb WHERE familyName=?
2002-08-26 17:39:10,315 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ContactInfoEJB] Executing SQL: INSERT INTO contactinfoejb (familyName, telephone, email, givenName, poIdd, PO_ID, status) VALUES (?, ?, ?, ?, ?, ?, ?)
2002-08-26 17:39:10,335 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.ContactInfoEJB] Could not create entity
java.sql.SQLException: General error: Column 'familyName' cannot be null
at org.gjt.mm.mysql.MysqlIO.sendCommand(Unknown Source)
at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(Unknown Source)
at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
any clue !
thanks -
3. Re: MySql ,JbossCMP2.0 and NOT NULL
faisalab Aug 27, 2002 3:40 AM (in response to faisalab)It was mysql own pb I'll never use mysql with CMP beans
thanks
Faisal -
4. Re: MySql ,JbossCMP2.0 and NOT NULL
faisalab Aug 29, 2002 1:56 AM (in response to faisalab)Well it wasn't MySql -it seems to be a serious bug in jboss
Faisal -
5. Re: MySql ,JbossCMP2.0 and NOT NULL
dsundstrom Aug 29, 2002 11:40 AM (in response to faisalab)I doubt this is a bug, because if it were no application would run on JBoss.
What is the Java type and SQL type of the telephone or faimlyName field?
Are you creating the table by hand or allowing JBoss to do it for you?
Did you set a value for telephone or familyName? If they are declared not null and are not primitives you must set a value.
What is the primary key field and type? Are you using a custom pk class?