Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbPostCreate doesn't execute

 
Kalle Anka
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm using EJB 2.1 and I'm new to J2EE. I experience some problems with CMR so I'm trying to debug my code with some silly System.out.println statements, and I found that ejbPostCreate(...) doesn't execute for some reason unexplainable. Can anyone shed some light into this?

I've attached parts of the code below. When I run this code only "yoyo1" is displayed... leaving "yoyo2" in ejbPostCreate out.


/**
*
* @ejb.bean name="UserBevaka"
* display-name="Name for UserBevaka"
* description="Description for UserBevaka"
* local-jndi-name = "ejb/UserBevaka"
* type="CMP"
* cmp-version="2.x"
* view-type="local"
* primkey-field = "uniktBevakningsID"
* schema="userBevakaSchema"
*
* @ejb.pk class = "java.lang.Integer"
*
* @ejb.persistence table-name="userbevaka"
*
* @ejb.home generate="local" local-class="test.interfaces.UserBevakaLocalHome"
* @ejb.interface generate="local" local-class="test.interfaces.UserBevakaLocal"
*
* @jboss.entity-command name="mysql-get-generated-keys"
*
*/
public abstract class UserBevakaBean implements EntityBean {

.
.
.

/**
* Create method
* @ejb.create-method view-type = "local"
*/
public java.lang.Integer ejbCreate(
java.lang.String username,
java.lang.Integer uniktAnstalldID,
AnstalldLocal anstalld) throws javax.ejb.CreateException {
System.out.println("yoyo1");
setUsername(username);
setUniktAnstalldID(uniktAnstalldID);
setCreateDate(new java.sql.Date(new java.util.Date().getTime()));
return null;
}
/**
* Post Create method
*/
public void ejbPostCreate(
java.lang.String username,
java.lang.Integer uniktAnstalldID,
AnstalldLocal anstalld) throws javax.ejb.CreateException {
System.out.println("yoyo2");
setAnstalld(anstalld);
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic