db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <tfisc...@apache.org>
Subject Re: TorqueSecurityService fails tests/NPE in BasePeer
Date Tue, 21 Aug 2007 21:25:35 GMT
I'm not sure if I understand the turbine initialisation process of Torque 
correctly. I assume the following (correct me if I'm wrong):

1) Torque.init(...) is called before a select is attempted.

2) In the configuration provided to Torque.init(), the key 
"torque.database.default" is set to the value "default"

If this is the case, in TorqueInstance.java line 314ff it is ensured that 
the database "default" is not null.

Maybe this is relevant: I remember dimly that there was some mad logic 
with the word "default" when the default database was not set, which was 
used by turbine. I removed this logic during clean-up of 
the torque initialisation process back in 2005. I'd guess this is the 
relevant commit message:
http://mail-archives.apache.org/mod_mbox/db-torque-dev/200507.mbox/%3C20050708175334.64249.qmail@minotaur.apache.org%3E

   Regards,

     Thomas

On Sat, 18 Aug 2007, Thomas Vandahl wrote:

> Hi folks,
>
> I'm in the process of making Turbine 2.3.3 "Torque 3.3" safe. (Torque
> folks, please read on!) This involved changing DBSecurityService to
> extend TorqueSecrityService and fixing the OM-classes in the Turbine
> code base. I will comment on this separately.
>
> Now after doing this, the TurbineSecurity tests failed on me. So I
> thought I broke this. But further debugging showed that I get a
> NullPointerException in BasePeer.doSelect() because the database adapter
> of the "default" database is null (This has always been the case!).
>
> This is a standard operation that happens with every doSelect() call and
> would have been surfaced long ago, so I'm puzzled why this happens here.
> Obviously some mapping from the "default" database reference to the real
> database object is missing. The only difference of the call in
> TorqueSecurityService is that the Peer class methods are being called by
> introspection.
>
> I managed to fix it by adding the DBAdapter in addition to the
> DataSourceFactory of the default database to the "reference database". I
> suspect, however, that this only cured a symptom, not the real cause.
> Any help on this is appreciated.
>
> Still puzzled,
> Thomas.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message