Hi Guys,

Sorry if this sounds a stupid question, but I am having problems with manual 
database table creation with Hypersonic and entity beans.

I have a simple entity bean. I can ask Jboss to automatically create a table 
when the bean is deployed by defining this in my jbosscmp-jdbc.xml file:


  | <jbosscmp-jdbc>
  |    <defaults>
  |       <datasource>java:/DefaultDS</datasource>
  |       <datasource-mapping>Hypersonic SQL</datasource-mapping>
  |       <create-table>true</create-table>
  |    </defaults>
  |    <enterprise-beans>
  |       <entity>
  |          <ejb-name>Entity1Bean</ejb-name>
  |              <table-name>PERSON</table-name>
  |              <cmp-field>
  | ....
  | 

And then I run my client to create a bean, all works fine and the entity is 
created in the database (checked using DatabaseManager).

If I drop the table and create it using SQL (actually from ant) using the 
following sql code:

  | create text table person
  | ( 
  |     pid varchar not null primary key,
  |     name varchar,
  |     age integer
  | );
  | commit;
  | 

and change the jbosscmp-jdbc.xml entry:

  | ....
  | <create-table>false</create-table>
  | ....
  | 

Then redeploy the app, all seems fine until I run the client.  When the client 
calls the create() method, I get this:

 CreateException:Could not create entity:java.sql.SQLException: The table's 
data source for has not been defined in statement [INSERT INTO PERSON (pid, 
name, age) VALUES (?, ?, ?)]

I have examined the table schema created by the sql file compared to that 
generated by jboss and they seem identical. 

Am I missing something here or do I need to configure something else ?

Any help would be appreciated!

Thanks,
Clive

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

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


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to