Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

ejbCreate, ejbPostCreate and ejbStore called but no rows are inserted

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a CMP EB. All 3 methods : ejbCreate, ejbPostCreate and ejbStore are called without errors when I call my EB LocalHome's create(Integer i, String s). But when I check the DB, no rows are inserted.

When I try to call the same EB's create() the 2nd time, it throws :
javax.ejb.DuplicateKeyException: Entity with primary key 1234 already exists - which is the correct behaviour. But I can't see any rows being inserted.

Anywhere I can check and verify ?

Server : JBoss_4_0_3_SP1
Database : MySQL Server 5.0
EJB : 2.x
Java : j2sdk1.4.2_10
J2EE : 1.4


Thanks.
[ January 06, 2006: Message edited by: Timothy Toe ]
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After invoking create(), what do you get if you invoke findByPrimaryKey()?
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did you commit the record?
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems to be a DB Locking issue...close SQL Server & open it one more time..same hopeless things happen with Access...

Shrinivas
 
Timothy Toe
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies.

In my jbosscmp-jdbc.xml, I have :


When I coded this, I had in mind that the table name in my MySQL DB would be "info_try_eb". I kept on checking on table "info_try_eb" without realising that JBoss had, instead, helped me create a new table by the name of "ebinfoejbname", and inserted the new record there (when I call create).

Why ? Why the new table ?

In fact, I had gotten table "info_try_eb" ready for the CMP EB to use.


Thanks.
[ January 12, 2006: Message edited by: Timothy Toe ]
 
Something must be done about this. Let's start by reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic