Re: EO_PK_TABLE not being created
Pascal Robert <[email protected]> Sat, 3 Sep 2011 16:17:31 -0400
| Newsgroups | gmane.comp.web.webobjects.woproject.devel |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail-1--381080972 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Le 2011-09-03 =E0 15:49, Mike Warren a =E9crit : > Cord, >=20 > The default behavior I see for creating new EOs is with the selection = of a primary key from a db sequence. =20 That's the default behavior if the RDBMs support sequences, and MySQL = doesn't. You have to create the EO_PK_TABLE by using the SQL generation = in Entity Modeler and select "Create primary support", it will generate = the correct SQL code to create the table. > An easy test would be to create a sequence named registration_seq (for = db table registration) and the primary key should be auto created for = you during your insert. The other controls for primary key are found in = the Entity Modeler app.=20 >=20 > Hope this helps, > Mike >=20 > On Sep 3, 2011, at 12:39 PM , "Cord Sengbusch" = <[email protected]> wrote: >=20 >> Hi All - >>=20 >> I am using Eclipse, WOLips, WebObjects 5.3.3 and MySQL for a small = project. >>=20 >> I am able to query tables in my database, but as soon as I try to = insert a row using my WebObjects application, I get the following = exception: >>=20 >> Error: java.lang.IllegalStateException: Adaptor = com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf03 failed to provide new = primary keys for entity 'Registration' >> Reason: Adaptor com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf03 = failed to provide new primary keys for entity 'Registration' >>=20 >> In Entity Modeler I have com.webobjects.jdbcadaptor.MySQLPlugIn as = the the Plugin in the config file. >>=20 >> When viewing my database I do not see an EO_PK_TABLE. >>=20 >> Not sure how to get my application to create/use the eo_pk_table. >>=20 >> Thanks for the help. >>=20 >> Cord --Apple-Mail-1--381080972 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 <html><head></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; = "><br><div><div>Le 2011-09-03 =E0 15:49, Mike Warren a =E9crit = :</div><br class=3D"Apple-interchange-newline"><blockquote = type=3D"cite"><div = bgcolor=3D"#FFFFFF"><div>Cord,</div><div><br></div><div>The default = behavior I see for creating new EOs is with the selection of a primary = key from a db sequence. = </div></div></blockquote><div><br></div><div>That's the default = behavior if the RDBMs support sequences, and MySQL doesn't. You have to = create the EO_PK_TABLE by using the SQL generation in Entity Modeler and = select "Create primary support", it will generate the correct SQL code = to create the table.</div><br><blockquote type=3D"cite"><div = bgcolor=3D"#FFFFFF"><div>An easy test would be to create a sequence = named registration_seq (for db table registration) and the primary key = should be auto created for you during your insert. The other = controls for primary key are found in the Entity Modeler = app. <br><br>Hope this helps,<br><div>Mike</div></div><div><br>On = Sep 3, 2011, at 12:39 PM , "Cord Sengbusch" <<a = href=3D"mailto:[email protected]">[email protected]</a>> = wrote:<br><br></div><div></div><blockquote type=3D"cite"><div>Hi All = -<div><br></div><div>I am using Eclipse, WOLips, WebObjects 5.3.3 and = MySQL for a small project.</div><div><br></div><div>I am able to query = tables in my database, but as soon as I try to insert a row using my = WebObjects application, I get the following exception:</div> <div><br></div><div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; "><table border=3D"0" width=3D"100%"><tbody><tr><td = align=3D"right" valign=3D"top" height=3D"13"> <b>Error:</b></td><td align=3D"left" valign=3D"top" = height=3D"13">java.lang.IllegalStateException: Adaptor = com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf03 failed to provide new = primary keys for entity 'Registration'</td></tr> <tr><td align=3D"right" valign=3D"top"><b>Reason:</b></td><td = align=3D"left" valign=3D"top">Adaptor = com.webobjects.jdbcadaptor.JDBCAdaptor@a8cf03 failed to provide new = primary keys for entity 'Registration'<br></td></tr></tbody></table> <br></span></div><div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; ">In Entity Modeler I = have com.webobjects.jdbcadaptor.MySQLPlugIn as the the Plugin in = the config file.</span></div> <div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; "><br></span></div><div><font class=3D"Apple-style-span" = face=3D"Times" size=3D"3"><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px;">When viewing my database I do not = see an EO_PK_TABLE.</span></font></div> <div><font class=3D"Apple-style-span" face=3D"Times" size=3D"3"><span = class=3D"Apple-style-span" style=3D"-webkit-border-horizontal-spacing: = 2px; -webkit-border-vertical-spacing: = 2px;"><br></span></font></div><div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; ">Not sure how to get my application to create/use the = eo_pk_table.</span></div> <div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; "><br></span></div><div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; ">Thanks for the help.</span></div> <div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; "><br></span></div><div><span class=3D"Apple-style-span" = style=3D"-webkit-border-horizontal-spacing: 2px; = -webkit-border-vertical-spacing: 2px; font-family: Times; font-size: = medium; ">Cord</span></div> </div></blockquote></div></blockquote></div><br></body></html>= --Apple-Mail-1--381080972--