-
1. Re: Blob - Problem deploying using JBoss 3 CR1 and Mysql
davidjencks Apr 18, 2002 9:23 AM (in response to jcraig)IMO you are correct that the db config is correct. It looks like the titleID is getting mapped to a BLOB column. Maybe it is seen as a plain java object that is getting serialized???
-
2. Re: Blob - Problem deploying using JBoss 3 CR1 and Mysql
jcraig Apr 18, 2002 9:43 AM (in response to jcraig)Hi... Thanks for the quick response! My primary key is a serializable java object. (Doesn't seem to be many examples/people which use this approach). It always works when I use the hypersonic db. The primary key object get stored as a blob. It also used to work when I used MySQL with CMP1. Are there any problems with having 'custom' objects as your primary key class when using MySQL etc? It I convert the primary to use an Integer for example everything works fine.
I have included an extract of my ejb-jar file below. Maybe it will help...
<ejb-name>Title</ejb-name>
<local-home>za.co.connectivit.ptisan.misc.TitleLocalHome</local-home>
za.co.connectivit.ptisan.misc.TitleLocal
<ejb-class>za.co.connectivit.ptisan.misc.TitleBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>za.co.connectivit.ptisan.misc.TitleID</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>TitleBean</abstract-schema-name>
<cmp-field>
<field-name>titleID</field-name>
</cmp-field>
<cmp-field>
<field-name>name</field-name>
</cmp-field>
<cmp-field>
<field-name>description</field-name>
</cmp-field>
<primkey-field>titleID</primkey-field>
<resource-ref>
<res-ref-name>jdbc/mySQLDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref> -
3. Re: Blob - Problem deploying using JBoss 3 CR1 and Mysql
dsundstrom Apr 18, 2002 1:15 PM (in response to jcraig)Most databases won't let you use a blob as a primary key, because you can't index a blob.
-
4. Re: Blob - Problem deploying using JBoss 3 CR1 and Mysql
jcraig Apr 19, 2002 5:12 AM (in response to jcraig)By the look of things MySQL does allow a primary key data type to be larger 255. After careful consideration I have decided to change my approach with regard to using 'custom' java objects as primary keys. I am going to go the unique OID route. I don't want to have to limit my choice in databases because to primary key/indexing restrictions.
Thanks for all the help.