If this is the case then why would a person not use 'synchronized'?
Take Care
Jason Kary
Bartek Walter wrote:
> jb> This is part of source code of BaseXXX
>
> jb> ...
> jb> public void save(DBConnection dbCon) throws Exception
> jb> {
> jb> if (!alreadyInSave)
> jb> {
> jb> alreadyInSave = true;
> jb> if (isModified())
> jb> {
> jb> if (isNew())
> jb> {
> jb> XXXPeer.doInsert((XXX)this, dbCon);
> jb> setNew(false);
> jb> }
> jb> else
> jb> {
> jb> XXXPeer.doUpdate((XXX)this, dbCon);
> jb> }
> jb> }
> jb> alreadyInSave = false; // Why this line? It's just saved, right?
> jb> }
> jb> }
> jb> ...
>
> it is a kind of a semaphore, I think, in order to avoid race
> conditions when saving the same object concurrently.
> This method is not synchronized probably for efficiency purposes, so
> the semaphore does the job.
>
> Regards,
> -Bartek Walter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]