• Post Reply Bookmark Topic Watch Topic
  • New Topic

isModified

 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone explain what is isModified.
and why do we make it true in some method that has changed the bean instance variable values. and when do we make false??
Thanx,
Deepak.
 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Its an advanced way of persisting the data thru entity beans, in case of BMP. When ever the ejbstore is called new data is persisted into database, after persisting (by executing the SQL statement), isModified is set to true stating that the data is modified. When the EJBLoad method is called, it checks for isModified, if it is true then the select SQL is executed to set the entity bean data. This is done, since the ejbStore and ejbLoad methods are controlled by container, and to load the data only whenever it is changed.
Hope this helps
Hari
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Deepak,
The isModified method id there to remove multiple calls to the database by the entity bean to store the data that the EB reflects. If you have a bean managed persistence and are controlling the persistence, u will set isModified only when the attributes in the bean have changed. This will tell the container that the ejb needs to be persisted and hence the ejbStore method is called and the database updated with the new values for the attributes.
For controlling the multiple access to ejbLoad, u have to set the db-is-shared attribute in the DD. This is the att which tells the Container whether the field attributes can be changed by only u or by any other piece in the appln.
HTH
S
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!