• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Jboss:Hypersonic:Manual table creation:CreateException

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I know this is a rather jboss/hypersonic 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:


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:



The 'text' is a Hypersonic-specific sql statement.

and change the jbosscmp-jdbc.xml entry:




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
 
clive jordan
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I solved this problem so thought I'd round off in case anyone ever has the same issue.

In the hypersonic documentation, it states that you need to create a table with the text attribute in order to make it persistant and not a memory-only table:

[CODE}
create [B]text[/B] table person
(
pid varchar not null primary key,
name varchar,
age integer
);
[/CODE]

However, this seems to cause Jboss to not recognize the table. Removing the 'text' solved the problem. So either the documentation is incorrect (or I dont understand it) or Jboss does something under the covers to make the table permanent when accessing it.

Clive
 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic