Hi,

My mistake, the flag for weblogic is called <delay-updates-until-end-of-tx>.  Setting 
to
false only modifies the behavior of the ejb container and does not affect db 
commitment:

http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_reference.html#1052175

What app server are you using?  This will play a cruicial role the behavior you are
seeing vs. expecting.

Gene
--- Cherry Mathew <[EMAIL PROTECTED]> wrote:
> Hi Gene,
> but i dont want the meth1() to commit before meth2() finishes.
> Do u mean to say that there is nothing i can do about this?.
> Again another scenario i want to ask about is
>  remoteMet(){
>   meth1();
>   meth2();
>  }
>  meth1(){
>   get connection
>    do operations
>   close connection
>  }
>  meth2(){
>   get connection
>    do some operation
>   close connection
>  }
>
>  What i want to ask is will the meth1() commit when i close the connection.
>  If yes what if i use a entity bean in both the methods. Even that may use a 
>different
> connection for each entity bean.
>  again in the same scenario. how will i force the entity bean to commit the 
>operations
> done in meth1() before calling meth2(). I want to use container managed transaction.
> One option is to use isolation level read uncommitted in meth2().Is there a cleaner 
>way
> of doing this?.
>  I want to do this because im using the entity bean to insert 1000 records in the
> database. And in meth2() im sorting those records. If i go for direct JDBC insert 
>then
> it will affect the preformance. and if i use the entity bean for sorting again it 
>will
> affect performance.
>  Can someone give me more details about how transaction is maintained across
> connections if it can done.
>  If transaction cannot be maintained across connections then how can we rely on the
> entity baen call (to be part of transaction).
>
> --- Gene Chuang <[EMAIL PROTECTED]> wrote:
> > Hi Cherry,
> >
> > The problem you are seeing occurs when you mix EJB
> > and JDBC invocation within a single
> > transaction, and is an issue that's expressed (and
> > solvable) in many containers which has
> > a caching mechanism for EJBs.
> >
> > For example, under weblogic, if you set
> > <commit-at-end-of-transaction> to false, this
> > will force all ejb changes to commit immediately,
> > hence allowing your JDBC calls to see
> > these changes.
>
> Thanx a lot Gene
> >
> > Hope that helps!
> >
> > Gene
> > --- Cherry Mathew <[EMAIL PROTECTED]> wrote:
> > > Hi Michael,
> > >  I used the dafault isolation level that is READ
> > COMMITTED.  If im in the same
> > > transaction dont u think that i need to get the
> > values which were inserted in meth1()
> > > whether i commit meth1() or not?.
> > >
> > > i start a transaction in remoteMeth()
> > > call meth1() which uses entity bean to create
> > records in the database.
> > > now from remoteMeth() i call meth2() and try to
> > access these records. And im not
> > > getting these records in meth2().
> > > I think since im inserting records in the same
> > transaction i need to get the records
> > > for updates in the same transaction context.
> > >  If im trying to access the records in a different
> > transaction context it shouldnt give
> > > me uncommitted records. But when in same
> > transaction contect i should get the values.
> > >
> > > Thank u very much
> > >
> > > Cherry Mathew
> > >
> > >
> > > --- tetex <[EMAIL PROTECTED]> wrote:
> > > > What's the isolation level for each connection?
> > I
> > > > would consider this.
> > > >
> > > > Michael
> > > >
> > > > ----- Original Message -----
> > > > From: "Cherry Mathew" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Saturday, October 20, 2001 6:35 AM
> > > > Subject: Problems in transactions
> > > >
> > > >
> > > > > Scenario,
> > > > >
> > > > > Session bean
> > > > > ------------
> > > > >  public void remoteMeth(){
> > > > >    meth1();
> > > > >    meth2();
> > > > >  }
> > > > >  public void meth1(){
> > > > >    //uses entity bean to insert data into the
> > > > databaseTable
> > > > >    //transaction type is required
> > > > >  }
> > > > >  public void meth2(){
> > > > >   // gets a connection using JNDI lookup from
> > the
> > > > connection pool
> > > > >   // Does updates on the same table on which
> > meth2
> > > > inserts data into
> > > > >   // transaction type is required
> > > > >   // the problem is that this function is not
> > > > finding any rows in the
> > > > >     databaseTable to update
> > > > >  }
> > > > >
> > > > >  ( the inserts by the Entity bean succedes. )
> > > > >
> > > > >  from this what i think is that both the
> > methods
> > > > are not executing in the
> > > > same transaction context.
> > > > >  But why?. When the  call comes to the remote
> > > > method a new transaction is
> > > > created. meth1() and meth2() should take this
> > same
> > > > transaction.
> > > > >
> > > > >  Am i missing something. The reason i can
> > think of
> > > > is because the entity
> > > > bean is using a new database connection to
> > insert
> > > > the row in the database
> > > > the transaction is not getting effect. And the
> > > > meth2() gets a new database
> > > > connection. Work around is that i can use the
> > entity
> > > > bean for updates also
> > > > but that doesnt solve my doubt.
> > > > >
> > > > > Thanx in advance
> > > > >
> > > > > regards
> > > > > Cherry
> > > > >
> > > > >
> > > >
> > ===========================================================================
> > > > > To unsubscribe, send email to
> > > > [EMAIL PROTECTED] and include in the
> > > > body
> > > > > of the message "signoff EJB-INTEREST".  For
> > > > general help, send email to
> > > > > [EMAIL PROTECTED] and include in the body
> > of
> > > > the message "help".
> > > > >
> > > >
> > >
> > >
> > ===========================================================================
> > > To unsubscribe, send email to
> > [EMAIL PROTECTED] and include in the body
> > > of the message "signoff EJB-INTEREST".  For
> > general help, send email to
> > > [EMAIL PROTECTED] and include in the body of
> > the message "help".
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> >
> > ===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > and include in the body
> > of the message "signoff EJB-INTEREST".  For general
> > help, send email to
> > [EMAIL PROTECTED] and include in the body of the
> > message "help".
> >
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to