OK I got it figured. I got the dead lock situation that Ole sketched. BTW if
anyone is dealing with accounts and account balances NEVER update the
account balance when you are inserting line items, you are sure to get
deadlock. Only update the balance once in a while, or when necessary (e.g.
when the customer wants to withdraw funds), from information in the account
line items.

> >
> >
> > I believe the EJB standard says that if a transaction has
> > entity bean A
> > in it, no other transactions may access entity bean A until the first
> > transaction completes. Is this the default behavior on jboss? If not
> > default, is it an option. This leads me to the question - If
> > I have one
> > transaction that grabs entity bean A while another transaction grabs
> > entity bean B, and then the first transaction tries to get
> > entity bean B
> > while the second transaction tries to get entity bean A, will that
> > result in deadlock? Or is the appserver smart enough to not even let
> > this happen in the first place?
> >
> >
> >

> -----Original Message-----
> From: marc fleury [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 27, 2001 2:33 PM
> To: jBoss
> Subject: RE: [jBoss-User] LOCKING-WAITING (TRANSACTION)
> 
> 
> hey,
> 
> 
> I would have to look at it.  Probably an exotic exception 
> that goes through
> the container and the instance remains in cache with a 
> transaction... don't
> know, can you really reproduce it or is it that you are just 
> banging on the
> cache with many clients (in which case it is normal and it 
> would explain the
> "recovery")
> 
> 
> marc
> 
> 
> |-----Original Message-----
> |From: [EMAIL PROTECTED]
> |[mailto:[EMAIL PROTECTED]]On Behalf Of Tobias Frech
> |Sent: Friday, January 26, 2001 11:01 AM
> |To: jBoss
> |Subject: Re: [jBoss-User] LOCKING-WAITING (TRANSACTION)
> |
> |
> |Hi Andrew!
> |I know that problem. From time to time we see it too. But 
> after an awful
> |long time (in measures of CPU time) the container recovers 
> somehow. To
> |help to pin down that problem we could collect all the 
> information about
> |when this occurs.
> |
> |Which version of JBoss are you using ?
> |
> |Can you reproduce this error or does it happen "randomly" ?
> |
> |Do you know if [InternalAccount] has just been called, was 
> called before
> |or is not involved in any transaction at the time this happens ? I am
> |not sure, but the later could be the case for me.
> |
> |Cheers,
> |Tobias
> |
> |"Nortje, Andrew" wrote:
> |>
> |> What does LOCKING-WAITING (TRANSACTION) mean?
> |>
> |> 1. Does it mean the row in the database is locked? OR
> |> 2. Access to the particular entity bean is locked - the
> |non-reentrant bean
> |> thing.
> |>
> |> Some notes -
> |> - I have no reentrant entity beans
> |> - Application works fine for one customer buy transaction
> |> - Application works fine, for a while, with multiple customer buy
> |> transactions - then I get the LOCKING-WAITING 
> (TRANSACTION) - forever
> |> - Seems like a deadlock
> |>
> |> Any ideas?
> |>
> |> Thanks
> |>
> |> Andrew
> |>
> |> [InternalAccount] Transaction insert() called  
> Transaction: ID 0 Debit 0
> |> Credit 65 Amount 2.5 Parent 6192
> |> [InternalAccount] SQL: Insert into TRANSC ( TRANSC_ID, 
> PARENT_TRANSC_ID,
> |> DEBIT_ACCOUNT_ID,  CREDIT_ACCOUNT_ID, TRANSC_DATE,
> |EFFECTIVE_DATE, AMOUNT,
> |> STATUS, DESCRIPTION, TRANSC_TYPE_ID ) values ( 6195, 6192, 0, 65,
> |> to_date('2001-01-26 02:41:02','YYYY-MM-DD HH24:MI:SS'),
> |to_date('2001-02-25
> |> 02:41:02','YYYY-MM-DD HH24:MI:SS'), 2.5, 1, 'COMMISSION', 5 )
> |> [InternalAccount]  Transaction: ID 6195 Debit 0 Credit 65 Amount
> |2.5 Parent
> |> 6192 Transaction amount = 2.5
> |> [InternalAccount] Updating account balance
> |> com.uni.account.InternalAccountBean@34cdfc
> |> For entity with ID 0
> |> Account ID 0
> |> Balance = 856.2 +
> |> -2.5##############################################################
> |> [Person] LOCKING-WAITING (TRANSACTION) for id
> |> com.uni.entity.myaccount.PersonPK@4a7c ctx.hash 6146369
> |> tx:TransactionImpl:XidImpl:[B@7fb9e1
> |> [InternalAccount] LOCKING-WAITING (TRANSACTION) for id
> |> com.uni.account.AccountPK@0 ctx.hash 4092026
> |> tx:TransactionImpl:XidImpl:[B@49e87
> |> [Person] LOCKING-WAITING (TRANSACTION) for id
> |> com.uni.entity.myaccount.PersonPK@4a7c ctx.hash 6146369
> |> tx:TransactionImpl:XidImpl:[B@43e93d
> |>
> |> --
> |> --------------------------------------------------------------
> |> To subscribe:        [EMAIL PROTECTED]
> |> To unsubscribe:      [EMAIL PROTECTED]
> |> List Help?:          [EMAIL PROTECTED]
> |
> |
> |--
> |--------------------------------------------------------------
> |To subscribe:        [EMAIL PROTECTED]
> |To unsubscribe:      [EMAIL PROTECTED]
> |List Help?:          [EMAIL PROTECTED]
> |
> 
> 
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]
> 


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to