Completely confused about SessionSynchronization

I'm having a tough time understanding what SessionSynchronization does and when it should be used. All I do know it can only be used with stateful session beans.
What can it do that requires its use? I've read things about synchronizing instance variables after rollbacks and commits...but I have no idea why and how SessionSychronization does this. And why it's not done automatically anyways.
Can somebody please clarify my confusion in detailed but understandable terms?
Thanks.

and whether a transaction commite or was rolled back
determines what the new values of those instance
variables would be!! Is this correct?Yes, when it comes to transaction lifecycle notifications, it's important
to be able to find out whether the transaction successfully committed
or not.
>
That explains afterCompletion(boolean), but I still
see no use for afterBegin() and beforeCompletion()afterBegin() is called the first time the SFSB is involved in the new
transaction. It's a convenient place to initialize the bean state
before business methods are called. afterBegin() is invoked within
the transaction so resource managers such as databases can be
accessed.
beforeCompletion() is called before the transaction is completed.
Like afterBegin, it is also called within the transaction context itself,
so e.g. it's the place where any pending resource manager updates
could be made. Those can't be done in afterCompletion(), because
there the transaction has already either committed or rolled back.
>
By the way, is there a difference between using JDBC
and using JDBC as part of BMP?Yes, BMP applies to EJB 1.x/2.x style Entity beans , which have
much different lifecycle and behavior than session beans. However,
going forward there is much less need to use either of these approaches
given the existence of the Java Persistence API.
--ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Confused about transaction, checkpoint, normal recovery.

    After reading the documentation pdf, I start getting confused about it's description.
    Rephrased from the paragraph on the transaction pdf:
    "When database records are created, modified, or deleted, the modifications are represented in the BTree's leaf nodes. Beyond leaf node changes, database record modifications can also cause changes to other BTree nodes and structures"
    "if your writes are transaction-protected, then every time a transaction is committed the leaf nodes(and only leaf nodes) modified by that transaction are written to JE logfiles on disk."
    "Normal recovery, then is the process of recreating the entire BTree from the information available in the leaf nodes."
    According to the above description, I have following concerns:
    1. if I open a new environment and db, insert/modify/delete several million records, and without reopen the environment, then normal recovery is not run. That means, so far, the BTree is not complete? Will that affact the query efficiency? Or even worse, will that output incorrect results?
    2. if my above thinking is correct, then every time I finish commiting transactions, I need to let the checkpoint to run in order to recreate the whole BTree. If my above thinking is not correct, then, that means that, I don't need to care about anything, just call transaction.commit(), or db.sync(), and let je to care about all the details.(I hope this is true :>)
    michael.

    http://www.oracle.com/technology/documentation/berkeley-db/je/TransactionGettingStarted/chkpoint.html
    Checkpoints are normally performed by the checkpointer background thread, which is always running. Like all background threads, it is managed using the je.properties file. Currently, the only checkpointer property that you may want to manage is je.checkpointer.bytesInterval. This property identifies how much JE's log files can grow before a checkpoint is run. Its value is specified in bytes. Decreasing this value causes the checkpointer thread to run checkpoints more frequently. This will improve the time that it takes to run recovery, but it also increases the system resources (notably, I/O) required by JE.
    """

  • Confused about standby redo log groups

    hi masters,
    i am little bit confuse about creating redo log group for standby database,as per document number of standby redo group depends on following equation.
    (maximum number of logfiles for each thread + 1) * maximum number of threads
    but i dont know where to fing threads? actually i would like to know about thread in deep.
    how to find current thread?
    thanks and regards
    VD

    is it really possible that we can install standby and primary on same host??
    yes its possible and i have done it many times within the same machine.
    For yours confusion about spfile ,i agree document recommend you to use spfile which is for DG broker handling if you go with DG borker in future only.
    There is no concern spfile using is an integral step for primary and standby database implementation you can go with pfile but good is use spfile.Anyhow you always keep pfile on that basis you created spfile,i said you make an entry within pfile then mount yours standby database with this pfile or you can create spfile from this pfile after adding these parameter within pfile,i said cause you might be adding this parmeter from SQL prompt.
    1. logs are not getting transfered(even i configure listener using net manager)
    2.logs are not getting archived at standby diectory.
    3.'ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION' NEVER COMPLETE ITS RECOVERY
    4. when tried to open database it always note it 'always' said system datafile is not from sufficiently old backup.
    5.i tried 'alter database recover managed standby database camncel' also.Read yours alert log file and paste the latest log here..
    Khurram

  • I am confused about Icloud. I have a 5 year old Macbook, a 2 year old macbook and a 5 year old mac mini. What exactly do I need to do to get all this connected via Icloud. I also have an Iphone 3G. Help please!

    I am confused about Icloud. I have a 5 year old Macbook, a 2 year old macbook and a 5 year old mac mini. What exactly do I need to do to get all this connected via Icloud. I also have an Iphone 3G. Help please! Also, I still don't understand exactly what the benefits are. At the moment it seems a lot of hassle to change a system that's been working perfectly well and that I'm very happy with. I'm not at all sure whether the mac mini (1.66 GHz INtel Core Duo) can be brought up to the relevant spec to run ICloud.  Any thoughts?

    There are two aspects to iCloud.  One is simply getting an account, or migrating a mobileme account to iCloud.  The second part is using the various features of iCloud to sync contacts, calendars, use music match or photo sharing, and store iWorks documents.
    First to get an iCloud account:
    If you have a mobileme account, you can migrate by simply logging onto www.icloud.com (ignore any references to Lion and just click through to complete the migration).  If you have OS X Lion or an iOS 5 mobile device, you can create an iCloud account on that device using any valid AppleID.
    Once you have an account, you can use JUST the mail account if you wishi - it is a standard IMAP account so you would set it up like any other IMAP email account you have, in whatever client program you use to read email.
    To use the OTHER feautes of iCloud, your computers will have to be running OS X Lion (10.7).  Your iPhone 3G will never be able to use iCloud as it cannot run iOS 5 (you need a min. of an iPhone 3GS to run iOS 5).
    The requirements for OS X Lion are here - http://www.apple.com/macosx/specs.html  You need a min. of a Core 2 duo processor so you mini is not capable of running Lion.
    So, in your case, the single reasons for iCloud would be if you have a mobileme account, then use the online www.icloud.com to migrate your account so you do not lose your @me.com email address.  You can use iCloud email (without using any other iCloud features) by setting it up as IMAP mail with these settings - http://support.apple.com/kb/HT4864
    If you want an iCloud account and do NOT already have a mobileme account, you will need to upgrade one machine at least to Lion in order to be able to create an iCloud account.

  • Confuse about Configuring Oracle Warehouse Builder

    newbie here... i am abit confuse on how to configure the Oracle Warehouse builder...
    I have 2 database... 1 source and 1 new one...
    I understand that i have to install the Runtime Repository in the database computer and the Target Schema through the client's computer...
    so all this while... i am just confuse about what to install into the source database and what to install into the new database...
    Please help...

    Location is a logical entity in your OWB design that can be either a database schema, a flat file location, an SAP application location etc. Once you complete your design and are ready to deploy the design into the runtime environment, you will have to 'register' the locations by providing the physical details of your location to OWB (user name/password, database, hostname etc.).
    I am a bit confused by your configuration - are the source and the target in two separate schemas or in the same schema? Your posts are somewhat contradictory.
    If they are in two different schemas, you should:
    1. Create a source module pointing to a source schema (you can then import data object structures from the source schema - i.e. you don't have to create source tables manually in OWB, but you can import them into the module automatically). This module will have a source location (for example SRC_LOC).
    2. Create a target module where all your target objects will be (i.e. where the data will be loaded). This module will have a different location (TGT_LOC). In your target module you will also create the mappings.
    3. When deploying, you will register SRC_LOC with the physical details of your source schema, while the target location will be registered with the physical details of the target schema. The code generated by OWB during deployment will make sure that the data is extracted from the source schema and inserted into the target schema (either by generating and using DB links or by qualifying the schemas in the extraction queries if source and target are in the same database instance).
    On the other hand, if both source and target objects are in the same db schema, you can have all your objects in the same target module and you will only have to register the location of this target module when deploying (LOC_TGT).
    That said, there can be a variety of reasons why there is no data in the target after you run the extract mapping that have nothing to do with locations, such as logical errors in the mapping (an inappropriate filter or a wrong join), insufficient privileges etc. I suggest you take a look in the runtime audit browser that should contain the error messages relative to your mapping.
    Regards:
    Igor

  • BE[Elect], MBA[SCM], 4 yrs Exp as BD. Totally confused about which SAP module

    Hello,
    Niranjan here from Mumbai. i am currently working as Lead member, Business development in engineering company for past 4+ years. Prior i have completed my BE from Mumbai university & MBA in supply change management.
    Now i am planning to have a shift to SAP. But confused about any specific module.
    On doing some ground work, found SD module of my use, but not sure about it.
    Also found CRM of my use on discussion with some of those working on field.
    Totally confused. ...
    Plz pour in your suggestions.
    thanks in advance.
    Niranjan Watve

    Hi Niranjan,
    As for my opinion, SAP CRM Sales exactly suits to you.  However, you have done Supply Chain Management you can also opt for SAP SD as well.
    But give a preference to SAP CRM Sales Instead of SAP SD.
    Regards
    GGOPII

  • Nested XML: completely confused

    Here is my XML with nested <a> tags in the text that
    sits in a node. I'm utterly stumped as to how to get at those
    <a> tags. The XML is valid, and when I run a standard Spry
    loop, none of the nodes with <a> tags will render. If I
    delete the <a> tags, the nodes render fine.
    Here is my XML, and below is my Spry:
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <Whats_New>
    <Item>
    <Date>06/23/08</Date>
    <News><a href="edms_document/EDMS/09016fea8046eb26"
    target="_blank"><em>P&#038;I
    Daily</em></a> reported Oregon Investment Council
    selects.</News>
    </Item>
    <Item>
    <Date>06/23/08</Date>
    <News>Mentioned in <a
    href="edms_document/EDMS/09016fea8046c419"
    target="_blank"><em>Ignites</em> report</a> on
    Associates research on increased demand for collective investments
    trusts.</News>
    </Item>
    <Item>
    <Date>06/18/08</Date>
    <News><a href="edms_document/EDMS/09016fea80467d9a"
    target="_blank"><em>Austin Business
    Journal</em></a> reported on American venture with
    ZZZ.</News>
    </Item>
    <Item>
    <Date>06/13/08</Date>
    <News>And this is another test <a href="
    http://www.cnn.com">to
    see</a> if this works.</News>
    </Item>
    <Item>
    <Date>06/09/08</Date>
    <News>Liability Investing director was recently quoted
    in an <a href="edms_document/EDMS/09016fea804659a4"
    target="_blank">article</a> distributed over the
    newswire.</News>
    </Item>
    </Whats_New>
    The example page I was looking at is completely confusing. Is
    there a straight ahead example or way to go about getting at this?
    Is it even possible with this data like this?
    Here is my HTML and Spry:
    <script type="text/javascript">
    var ds_whatsnew = new
    Spry.Data.XMLDataSet("xml/index_ds_whatsnew.xml?" + dateForXML(),
    "Whats_New/Item");
    var ds_ahref = new Spry.Data.NestedXMLDataSet(ds_whatsnew,
    "News/a");
    </script>
    <div spry:region="ds_whatsnew">
    <ul>
    <li spry:repeat="ds_whatsnew">{Date} -
    {News}</li>
    </ul>
    </div>
    I got as far as getting the right .js loaded and a ds named,
    but can't figure out what to do next.
    Help!
    Doug

    Nevermind. I realized I needed to just wrap all that in a
    CDATA tag and the problem is GONE.
    Doug

  • I'm confused about 'downloading' options via iTunes

    When updating via iTunes, you get two options: (1) Download & Install NOW or (2) Download only [to install later]. I chose the 2nd option, as I wasn't quite ready to update my iPod touch to iOS 5. The download went surprisingly quick... took only 5 minutes. I thought it was strange, considering that people were Tweeting left and right that it was going to take 5-7 hours for their downloads to complete. When I finally went to update my iPod several hours later, instead of the update being there and ready to install... iTunes connected to the Apple Servers and started downloading the entire iOS 5 from the BEGINNING! Now, I'm also getting the estimated 7 hours to complete mantra. What gives? What the h*** is the purpose of giving me an option to download and install at a later time, if that's now what actually takes place? What am I confused about? Can anyone provide some insight? I'm highly upset right now.

    "I just upgraded a song but i checked back a few hours later to see that the song i just upgraded was available for an upgrade that i already purchased.
    What sense does that make? "
    Er, none at all actually.
    Wanna re-post the question?

  • Confused about the battery...

    Hello everyone,
    I'm from Pakistan and I just switched to Mac almost 2-3 weeks ago. Since, they have proper apple authorized dealers here so I finally decided to get one for myself. I had some confusion about the battery and my system and now I'm getting very much concerned and worried as a matter of fact.
    I installed coconut battery (as few people suggested me) to check my battery status. First of all, it shows the age of my Mac as 5 months, which is pretty surprising since I got a brand new one and even the condition is of a brand new one so I have no clue why did it say that.
    Secondly, I would like to tell the condition of my battery:
    Current Battery Charge: 3591 mAh (I'm using on battery power right now)
    Maximum Battery charge: 4068 mAh
    88%
    Current Battery Capacity: 4068 mAh
    Original Battery Capacity: 4100 mAh
    99%
    Additional info:
    Battery-Loadcycles : 12
    Age of your Mac: 5 months
    Charger connected: No
    Battery is charging: No
    I am just concerned that my battery current capacity decreased to 99% after just 12 load cycles. Why is that? Some people tell that they have a 100% even after using it for a long time and other than that does anyone have any idea why is the age being shown as 5 months when I have only used it for 2 weeks.
    I'm really confused.
    Another suggestion that I want is that in Pakistan, we are having major electricity load shedding so I can't keep it on AC power most of the time so if my computer is shut-down and being charged. If the electricity goes and when it comes back and it starts charging to the point from where it left, will that waste the load-cycle or will it continue to charge it from there without wasting cycle? Does that affect the battery life? (Assuming that the computer is shut-down while being charged)
    Last thing, should I use it mostly on AC power or is it better to charge it and then drain the battery and then charge it and then use. Till how much percent should I keep using on the battery power and then connect the Magsafe connector?
    Please help people
    I'd highly appreciate if you could answer my questions.
    Thank you.

    I was told that it is best to keep it plugged in and connected to the charger when you can, but if you are not able to do that then just use battery power. I just know you don't want too many cycles, which means you don't want to drain the battery completely then fully recharge it. You should calibrate the battery, which is pretty much just draining battery then recharging it, every couple of months if you keep it plugged into the charger and don't use just the battery often.

  • I am confused about something.  How do I read a book on my MacBook Pro?  I can't find the iBook app anywhere, which is what I use on my iPad.  The book I want to read is in my iTunes but I can't click on it.  My iBook library does not show up in iTunes.

    I am confused about something.  How do I read a book on my MacBook Pro?  I can't find the iBook app anywhere, which is what I use on my iPad.  The book I want to read is in my iTunes but I can't click on it.  Some of my iBooks show up in my iTunes but they are "grayed" out.  The only books that respond in iTunes are audiobooks and that's not what I'm looking for.  Is this a stupid question?

    Nevermind - I answered my own question, which is I CAN"T READ ANY BOOKS I purchased in iBooks on my MacBook Pro.  If I want to read on my mac I have to use Kindle or Nook.  Which means any book I've already purchased through iBooks has to be read on my iPad.  Kind of a drag because there are times when it's more convenient for me to read while I'm sitting with my Mac.

  • Confuse about the injecting entity in EJB 3.0?

    Hi all,
    I have an customersBean which is inherit from customersRemote and my problem is i' am little confuse about injecting the entity(customer).
    Where can you apply the EntityManagerFactory is it outside on EJB or Inside the EJB? means outside EJB is use the web application or java application. i have and example.
    this is inside on EJB...............
    public class CustomersBean implements com.savingsaccount.session.CustomersRemote {
    @PersistenceContext(unitName="SavingAccounts")
    EntityManagerFactory emf;
    EntityManager em;
    /** Creates a new instance of CustomersBean */
    public CustomersBean() {
    public void create(int id, String name, String address, String telno, String mobileno)
    try{
    //This is the entity.
    Customer _customer = new Customer();
    _customer.setId(id);
    _customer.setName(name.toString());
    _customer.setAddress(address.toString());
    _customer.setTelno(telno.toString());
    _customer.setMobileno(mobileno.toString());
    em = emf.createEntityManager();
    em.persist(_customer);
    emf.close();
    }catch(Exception ex){
    throw new EJBException(ex.toString());
    in web application, i'm using the @EJB in customer servlets.
    public class CustomerProcessServlet extends HttpServlet {
    @EJB
    private CustomersRemote customerBean;
    blah blah inject directly coming request field from jsp.
    }

    Hi all,
    I have an customersBean which is inherit from customersRemote and my problem is i' am little confuse about injecting the entity(customer).
    Where can you apply the EntityManagerFactory is it outside on EJB or Inside the EJB? means outside EJB is use the web application or java application. i have and example.
    this is inside on EJB...............
    public class CustomersBean implements com.savingsaccount.session.CustomersRemote {
    @PersistenceContext(unitName="SavingAccounts")
    EntityManagerFactory emf;
    EntityManager em;
    /** Creates a new instance of CustomersBean */
    public CustomersBean() {
    public void create(int id, String name, String address, String telno, String mobileno)
    try{
    //This is the entity.
    Customer _customer = new Customer();
    _customer.setId(id);
    _customer.setName(name.toString());
    _customer.setAddress(address.toString());
    _customer.setTelno(telno.toString());
    _customer.setMobileno(mobileno.toString());
    em = emf.createEntityManager();
    em.persist(_customer);
    emf.close();
    }catch(Exception ex){
    throw new EJBException(ex.toString());
    in web application, i'm using the @EJB in customer servlets.
    public class CustomerProcessServlet extends HttpServlet {
    @EJB
    private CustomersRemote customerBean;
    blah blah inject directly coming request field from jsp.
    }

  • Confused about logical table source

    Hi,
    I'm confused about logical table source(LTS), there are 'General', 'Column Mapping', 'Content' tabs in
    LTS, in General tab ,there are some information,like 'Map to there tables' and 'joins',
    just here, we have created relationships in physical layer and BMM layer, so I would like to ask what's the use of the 'joins' here?

    Hi Alpha,
    Valid query, when you establish a complex join it is always between a logical fact and dimension table.Consider a scenario,
    Example:w_person_dx is an extension table not directly joined to a fact but joins to a dimension w_person_d.
    When you model the person_d tables in BMM, you ll have a single logical table with w_person_d as source.If you have to pull columns from both w_person_d and w_person_dx tables in a report, you add dx table as inner join to persond table in the general tab.Now when you check your physical query, you can see the inner join fired between the two dimensions.
    Rgds,
    Dpka

  • Confused about extending the Sprite class

    Howdy --
    I'm learning object oriented programming with ActionScript and am confused about the Sprite class and OO in general.
    My understanding is that the Sprite class allows you to group a set of objects together so that you can manipulate all of the objects simultaneously.
    I've been exploring the Open Flash Chart code and notice that the main class extends the Sprite class:
    public class Base extends Sprite {
    What does this enable you to do?
    Also, on a related note, how do I draw, say, a line once I've extended it?
    Without extending Sprite I could write:
    var graphContainer:Sprite = new Sprite();
    var newLine:Graphics = graphContainer.graphics;
    And it would work fine. Once I extend the Sprite class, I'm lost. How do I modify that code so that it still draws a line? I tried:
    var newLine:Graphics = this.graphics;
    My understanding is that since I'm extending the Sprite class, I should still be able to call its graphics method (or property? I have no idea). But, it yells at me, saying "1046: Type was not found or was not a compile-time constant: Graphics.

    Thanks -- that helped get rid of the error, I really appreciate it.
    Alas, I am still confused about the extended Sprite class.
    Here's my code so far. I want to draw an x-axis:
    package charts {
        import flash.display.Sprite;
        import flash.display.Graphics;
        public class Chart extends Sprite {
            // Attributes
            public var chartName:String;
            // Constructor
            public function Chart(width:Number, height:Number) {
                this.width = width;
                this.height = height;
            // Methods
            public function render() {
                drawAxis();
            public function drawAxis() {
                var newLine:Graphics = this.graphics;
                newLine.lineStyle(1, 0x000000);
                newLine.moveTo(0, 100);
                newLine.lineTo(100, 100);
    I instantiate Chart by saying var myChart:Chart = new Chart(); then I say myChart.render(); hoping that it will draw the axis, but nothing happens.
    I know I need the addChild method somewhere in here but I can't figure out where or what the parameter is, which goes back to my confusion regarding the extended Sprite class.
    I'll get this eventually =)

  • Confused about SOAP

    Hi all,
    As far as I know, SOAP is initially designed to be an XML based
    RPC protocol.
    But Java API for XML Messaging (JAXM), which is actually a
    messaging API (and not RPC), is also based on SOAP.
    How do they fit to each other?
    In a few words, what does actually SOAP define?
    I am confused about that, can you help me?
    Any idea will be appreciated.
    Thank you

    In a few words -- no. Try here:
    http://java.sun.com/webservices/docs/1.0/tutorial/index.html

  • Confused about passing by reference and passing by valule

    Hi,
    I am confuse about passing by reference and passing by value. I though objects are always passed by reference. But I find out that its true for java.sql.PreparedStatement but not for java.lang.String. How come when both are objects?
    Thanks

    Hi,
    I am confuse about passing by reference and passing
    by value. I though objects are always passed by
    reference. But I find out that its true for
    java.sql.PreparedStatement but not for
    java.lang.String. How come when both are objects?
    ThanksPass by value implies that the actual parameter is copied and that copy is used as the formal parameter (that is, the method is operating on a copy of what was passed in)
    Pass by reference means that the actual parameter is the formal parameter (that is, the method is operating on the thing which is passed in).
    In Java, you never, ever deal with objects - only references to objects. And Java always, always makes a copy of the actual parameter and uses that as the formal parameter, so Java is always, always pass by value using the standard definition of the term. However, since manipulating an object's state via any reference that refers to that object produces the same effect, changes to the object's state via the copied reference are visible to the calling code, which is what leads some folk to think of java as passing objects by reference, even though a) java doesn't pass objects at all and b) java doesn't do pass by reference. It passes object references by value.
    I've no idea what you're talking about wrt PreparedStatement, but String is immutable, so you can't change its state at all, so maybe that's what's tripping you up?
    Good Luck
    Lee
    PS: I will venture a guess that this is the 3rd reply. Let's see...
    Ok, second. Close enough.
    Yeah, good on yer mlk, At least I beat Jos.
    Message was edited by:
    tsith

Maybe you are looking for