2x ejbStore() per ejbCreate()?
cincaipatron Oct 17, 2001 10:31 AMHi,
Just curious, recently just found this behaviour.
I'm using cmp ejb, jboss 2.4.1, MySQL.
I put some code in ejbStore() to validate field to be
written do dbase (e.g: validating length) -- there's
assignment to each field, like:
id = (id.length() <= ID_LENGTH) ? id : id.substring(...);
My ejb consist of getXXX() and setXXX() for corresponding
fields, getDetail() which return "value object" also
ejbCreate(SerializedObj detail) where detial is "value
object" of this ejb.
In client, all I do is home.create(detail), and retrieve
detail from ejb via getDetail() method.
I insert (create) 2 entity, but JBOSS did 4 ejbStore()
(I assumed it should be 2?), which mean jboss did ejbStore()
twice per entity on creation?
I don't know if it's my ejb that does something wrong, or just
the way it is?
===================================================================
[Default] JBoss 2.4.1 Started in 0m:11s
[Default] ejb/UIDHighKeyGenerator
[Default] Product EJB: invoking ejbStore()
[Default] id before: 85808080808080808080808080808080
[Default] ID_LENGTH: 50
[Default] PLU_LENGTH: 50
[Default] NAME_LENGTH: 100
[Default] DESC_LENGTH: 65536
[Default] CATEGORY_ID_LENGTH: 15
[Default] CREATOR_LENGTH: 8
[Default] UPDATER_LENGTH: 8
[Default] URL_THUMB_LENGTH: 255
[Default] URL_IMG_LENGTH: 255
[Default] URL_BANNER_LENGTH: 255
[Default] COA_LENGTH: 50
[Default] id after: 85808080808080808080808080808080cincaipatron
[Default] Product EJB: ejbStore() invoked
[Default] Product EJB: invoking ejbStore()
[Default] id before: 85808080808080808080808080808080
[Default] id after: 85808080808080808080808080808080
[Default] Product EJB: ejbStore() invoked
===================================================================
[Default] Product EJB: invoking ejbStore()
[Default] id before: 85808080808080808080808080808180
[Default] id after: 85808080808080808080808080808180cincaipatron
[Default] Product EJB: ejbStore() invoked
[Default] Product EJB: invoking ejbStore()
[Default] id before: 85808080808080808080808080808180
[Default] id after: 85808080808080808080808080808180cincaipatron
[Default] Product EJB: ejbStore() invoked
===================================================================