Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:06:53+00:00 2026-05-30T01:06:53+00:00

While using container managed entity bean when is the bean stored to database by

  • 0

While using container managed entity bean when is the bean stored to database by the container?
Can this be controlled inside the servlet using some code statements or the container manages this automatically internally?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:06:55+00:00Added an answer on May 30, 2026 at 1:06 am

    Basically it is stored to the database when your transaction is committed.

    With CMP you can control this with transaction demarcation in the deplyment descriptor a’la

    <ejb-jar>
    ...
    <assembly-descriptor>
    ...
    <container-transaction>
    <method>
    <ejb-name>EmployeeRecord</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>EmployeeRecord</ejb-name>
    <method-name>updatePhoneNumber</method-name>
    </method>
    <trans-attribute>Mandatory</trans-attribute>
    </container-transaction>
    ...
    

    This is a snippet from the spec http://download.oracle.com/otn-pub/jcp/ejb-2.1-fr-spec-oth-JSpec/ejb-2_1-fr-spec.pdf

    When you invoke a method on an ejb a new transaction may be initiated by the container, depending on your demarcation, and if the method terminates successfully, the transaction may be committed, depending on this-and-that. For instance if your specific method was demarcated with requires-new, it will be committed, because it has it’s own transaction, but if it is demarcated with requires, and was called within an aready running transaction (for instance because it was called from a session bean method demarcated with, say, requires or requires-new), it will be committed when that enclosing transaction is committed. Or if it fails, not only the changes made inside that method will be rolled back, but also changes made inside the enclosing method call/transaction.

    While the deployment descriptor may allow for nested transactions, it actually boils down to how the database engine handles transactions in the end. Very often rdbms doesn’t really support nested transactions, but instead uses transaction savepoints, so what appears as recursive from the ejb-perspective may actually happen in a “linear” fashion in the database. In most scenarios the result is the same, though.

    It may also be relevant to consider transaction isolation level.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While using this code to serialize an object: public object Clone() { var serializer
While using Struts2, I am using several annotations to do my validations inside the
while using the following constructor $this->pdo = new PDO ($this->source, $this->username, $this->password); if I
Due to a recent issue i had some days ago (you can check this
While using Vim (at home and at work), I often find myself doing similar
While using regex to help solve a problem in the Python Challenge , I
While using the vector why do we sometime use the operator[] like homework[mid] but
While using Aptana and Eclipse for the first time in my programming life for
While using fixed width select tag , there is one bug in IE. When
while using g.drawImage(img,0,0,100,100,0,0,0,0,null) it does not produce any result. So how to draw on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.