You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by wis-test <te...@softenergy.de> on 2004/12/01 02:03:19 UTC
to many WARN logs
Hello there,
since we use ojb 1.0.1 we find in our tomcat logs many messages like this:
[org.apache.ojb.broker.core.PersistenceBrokerImpl] WARN: No running tx
found, please only store in context of an PB-transaction, to avoid
side-effects - e.g. when rollback of complex objects
Could it be a little bug? In my opinion it's not necessary each object
to set into a transaction, isn't it.
regards
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Thomas Franke <fr...@softenergy.de>.
Armin Waibel wrote:
> No. With enabled PB-tx you shouldn't get warnings of missing PB-tx.
> Do you made changes in PersistenceBrokerImpl or ConnectionManagerImpl?
> Could it be concurrency issue? Do several threads using the same PB
> instance?
I didn't make any changes in PersistenceBrokerImpl or
ConnectionManagerImpl? That's your job not mine. ;)
I call only this:
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
O.K., I will make another code review and I hope I'll find something.
regards
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Armin Waibel <ar...@apache.org>.
Thomas Franke wrote:
> Hi Thomas,
>
>> It's not a bug it's a feature :-) No, it's only a warning but very
>> helpful by telling you: Hey man, could it be you forget to bound your
>> transaction. I see it just like the deprecation messages displayed by
>> the javac - ignore them as you like, but using transactions isn't only
>> good style ... and to have _some_ WARN logs of these isn't hardly a
>> problem ;-)
>
> O.K. I understand and I have made a code review.
> I changed my code e.g. to this:
>
> broker.beginTransaction();
> broker.store(something);
> broker.commitTransaction();
>
> But I have the same log outputs. Can it be?
>
No. With enabled PB-tx you shouldn't get warnings of missing PB-tx.
Do you made changes in PersistenceBrokerImpl or ConnectionManagerImpl?
Could it be concurrency issue? Do several threads using the same PB
instance?
regards,
Armin
> regards Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Armin Waibel <ar...@apache.org>.
Thomas Franke wrote:
> Hi Thomas,
>
>> sorry, I was for 2 days out of office, now my comments below ...
>
> Thanks, Thomas.
>
>> Normally not. This coding does it for me. Wherever I changed my code
>> in this manner, I don't got the warning _for this place_ anymore ... I
>> think you got the warning further because your change didn't capture
>> each occurrence of unTXed stores to db.
>
> Well, I'll look for each store methode without transaction and change it
> in the right way.
>
>> The only criticism with the warning I see is that it won't tell you
>> where a tx was missed.
>
> I thing so too.
>
This will change in next release. Setting logging level to INFO will
additionally print a stack trace of the causing code.
regards,
Armin
> regards
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Thomas Franke <fr...@softenergy.de>.
Hi Thomas,
> sorry, I was for 2 days out of office, now my comments below ...
Thanks, Thomas.
> Normally not. This coding does it for me. Wherever I changed my code in
> this manner, I don't got the warning _for this place_ anymore ... I
> think you got the warning further because your change didn't capture
> each occurrence of unTXed stores to db.
Well, I'll look for each store methode without transaction and change it
in the right way.
> The only criticism with the warning I see is that it won't tell you
> where a tx was missed.
I thing so too.
regards
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Thomas Paradies <pa...@transit-online.de>.
Hi Thomas,
sorry, I was for 2 days out of office, now my comments below ...
>> It's not a bug it's a feature :-) No, it's only a warning but very
>> helpful by telling you: Hey man, could it be you forget to bound your
>> transaction. I see it just like the deprecation messages displayed by
>> the javac - ignore them as you like, but using transactions isn't only
>> good style ... and to have _some_ WARN logs of these isn't hardly a
>> problem ;-)
>
> O.K. I understand and I have made a code review.
> I changed my code e.g. to this:
>
> broker.beginTransaction();
> broker.store(something);
> broker.commitTransaction();
>
> But I have the same log outputs. Can it be?
Normally not. This coding does it for me. Wherever I changed my code in this
manner, I don't got the warning _for this place_ anymore ... I think you got the
warning further because your change didn't capture each occurrence of unTXed
stores to db.
The only criticism with the warning I see is that it won't tell you where a tx
was missed.
regards,
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Thomas Franke <fr...@softenergy.de>.
Hi Thomas,
> It's not a bug it's a feature :-) No, it's only a warning but very
> helpful by telling you: Hey man, could it be you forget to bound your
> transaction. I see it just like the deprecation messages displayed by
> the javac - ignore them as you like, but using transactions isn't only
> good style ... and to have _some_ WARN logs of these isn't hardly a
> problem ;-)
O.K. I understand and I have made a code review.
I changed my code e.g. to this:
broker.beginTransaction();
broker.store(something);
broker.commitTransaction();
But I have the same log outputs. Can it be?
regards Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
RE: to many WARN logs
Posted by Daniel Perry <d....@netcase.co.uk>.
> if you store objects without a PB-tx the Connection autoCommit is
> enabled. Thus if you try to store an object with references e.g. A-->B
> OJB first write B then write A. If insert of A fails, B could not be
> rollback (autoCommit enabled). That's why I introduced this warning on
> store/delete operations. If you store/delete only objects without
> references, then you can ignore this warning.
Fair point. Although a lot of the data in the systems i'm talking about is a
child in a collection, and are being updated individually. References are
all auto-update=false as the data they are referencing will be read only.
>
> > these messages as there is a lot of data access. This adds too much
> noise
> > to the logs of deployed apps. I think that perhaps these messages
> should be
> > demotes to INFO.
>
> Using OJB without PB-tx for store/delete could be dangerous, so in my
> opinion a warning seems adequate. Or do you think this is "INFO"
> level only?
Not sure. I tend to use WARNING and ERROR as runtime problems. ie. ERROR
for 'oh dear i've crashed' and WARNING for 'somthing dont look right'. And
then INFO and DEBUG for development/debugging. However that doesnt
necessarily apply to everyone!
What are other peoples thoughts?
Daniel.
>
> regards,
> Armin
>
>
> Daniel Perry wrote:
> > I too have noticed these warnings. I have a couple of apps where i have
> > used no transactions (as they seem pretty pointless for the apps in
> > question - all 'shared' data is read-only), and they are
> generating a LOT of
> > these messages as there is a lot of data access. This adds too
> much noise
> > to the logs of deployed apps. I think that perhaps these
> messages should be
> > demotes to INFO.
> >
> > Daniel.
> >
> >
> >
> >>-----Original Message-----
> >>From: Thomas Paradies [mailto:paradies@transit-online.de]
> >>Sent: 01 December 2004 13:15
> >>To: OJB Users List
> >>Subject: Re: to many WARN logs
> >>
> >>
> >>Hi Thomas,
> >>
> >>>since we use ojb 1.0.1 we find in our tomcat logs many messages
> >>
> >>like this:
> >>
> >>>[org.apache.ojb.broker.core.PersistenceBrokerImpl] WARN: No running tx
> >>>found, please only store in context of an PB-transaction, to avoid
> >>>side-effects - e.g. when rollback of complex objects
> >>>
> >>>Could it be a little bug? In my opinion it's not necessary each object
> >>>to set into a transaction, isn't it.
> >>
> >>It's not a bug it's a feature :-) No, it's only a warning but
> >>very helpful by
> >>telling you: Hey man, could it be you forget to bound your
> >>transaction. I see it
> >>just like the deprecation messages displayed by the javac -
> >>ignore them as you
> >>like, but using transactions isn't only good style ... and to
> >>have _some_ WARN
> >>logs of these isn't hardly a problem ;-)
> >>
> >>Thomas
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> >>For additional commands, e-mail: ojb-user-help@db.apache.org
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Armin Waibel <ar...@apache.org>.
Hi Daniel,
if you store objects without a PB-tx the Connection autoCommit is
enabled. Thus if you try to store an object with references e.g. A-->B
OJB first write B then write A. If insert of A fails, B could not be
rollback (autoCommit enabled). That's why I introduced this warning on
store/delete operations. If you store/delete only objects without
references, then you can ignore this warning.
> these messages as there is a lot of data access. This adds too much
noise
> to the logs of deployed apps. I think that perhaps these messages
should be
> demotes to INFO.
Using OJB without PB-tx for store/delete could be dangerous, so in my
opinion a warning seems adequate. Or do you think this is "INFO" level only?
regards,
Armin
Daniel Perry wrote:
> I too have noticed these warnings. I have a couple of apps where i have
> used no transactions (as they seem pretty pointless for the apps in
> question - all 'shared' data is read-only), and they are generating a LOT of
> these messages as there is a lot of data access. This adds too much noise
> to the logs of deployed apps. I think that perhaps these messages should be
> demotes to INFO.
>
> Daniel.
>
>
>
>>-----Original Message-----
>>From: Thomas Paradies [mailto:paradies@transit-online.de]
>>Sent: 01 December 2004 13:15
>>To: OJB Users List
>>Subject: Re: to many WARN logs
>>
>>
>>Hi Thomas,
>>
>>>since we use ojb 1.0.1 we find in our tomcat logs many messages
>>
>>like this:
>>
>>>[org.apache.ojb.broker.core.PersistenceBrokerImpl] WARN: No running tx
>>>found, please only store in context of an PB-transaction, to avoid
>>>side-effects - e.g. when rollback of complex objects
>>>
>>>Could it be a little bug? In my opinion it's not necessary each object
>>>to set into a transaction, isn't it.
>>
>>It's not a bug it's a feature :-) No, it's only a warning but
>>very helpful by
>>telling you: Hey man, could it be you forget to bound your
>>transaction. I see it
>>just like the deprecation messages displayed by the javac -
>>ignore them as you
>>like, but using transactions isn't only good style ... and to
>>have _some_ WARN
>>logs of these isn't hardly a problem ;-)
>>
>>Thomas
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Thomas Dudziak <to...@first.fhg.de>.
Daniel Perry wrote:
>I too have noticed these warnings. I have a couple of apps where i have
>used no transactions (as they seem pretty pointless for the apps in
>question - all 'shared' data is read-only), and they are generating a LOT of
>these messages as there is a lot of data access. This adds too much noise
>to the logs of deployed apps. I think that perhaps these messages should be
>demotes to INFO.
>
>
In general this is not a good idea because in most cases the data is not
read-only and then it *is* a warning. Also, you can always tune the
warning level for individual classes (e.g. set the level to ERROR for
org.apache.ojb.broker.core.PersistenceBrokerImpl).
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
RE: to many WARN logs
Posted by Daniel Perry <d....@netcase.co.uk>.
I too have noticed these warnings. I have a couple of apps where i have
used no transactions (as they seem pretty pointless for the apps in
question - all 'shared' data is read-only), and they are generating a LOT of
these messages as there is a lot of data access. This adds too much noise
to the logs of deployed apps. I think that perhaps these messages should be
demotes to INFO.
Daniel.
> -----Original Message-----
> From: Thomas Paradies [mailto:paradies@transit-online.de]
> Sent: 01 December 2004 13:15
> To: OJB Users List
> Subject: Re: to many WARN logs
>
>
> Hi Thomas,
> > since we use ojb 1.0.1 we find in our tomcat logs many messages
> like this:
> >
> > [org.apache.ojb.broker.core.PersistenceBrokerImpl] WARN: No running tx
> > found, please only store in context of an PB-transaction, to avoid
> > side-effects - e.g. when rollback of complex objects
> >
> > Could it be a little bug? In my opinion it's not necessary each object
> > to set into a transaction, isn't it.
>
> It's not a bug it's a feature :-) No, it's only a warning but
> very helpful by
> telling you: Hey man, could it be you forget to bound your
> transaction. I see it
> just like the deprecation messages displayed by the javac -
> ignore them as you
> like, but using transactions isn't only good style ... and to
> have _some_ WARN
> logs of these isn't hardly a problem ;-)
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: to many WARN logs
Posted by Thomas Paradies <pa...@transit-online.de>.
Hi Thomas,
> since we use ojb 1.0.1 we find in our tomcat logs many messages like this:
>
> [org.apache.ojb.broker.core.PersistenceBrokerImpl] WARN: No running tx
> found, please only store in context of an PB-transaction, to avoid
> side-effects - e.g. when rollback of complex objects
>
> Could it be a little bug? In my opinion it's not necessary each object
> to set into a transaction, isn't it.
It's not a bug it's a feature :-) No, it's only a warning but very helpful by
telling you: Hey man, could it be you forget to bound your transaction. I see it
just like the deprecation messages displayed by the javac - ignore them as you
like, but using transactions isn't only good style ... and to have _some_ WARN
logs of these isn't hardly a problem ;-)
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org