It's not really a deficiency in the security service. It is a general
problem with using torque which now throws TorqueException in many
methods. The generated classes are now unable to implement interfaces
which are not written to be able to throw the TorqueException.
So if you have an interface
interface Foo
{
getBar() throws InstantiationException;
}
and you would like to use torque to generate a FooImpl that uses a table
that contains a BAR_ID column. Torque will generate a
getBar() throws TorqueException
So you cannot use torque unless you are willing and able to modify the
Foo interface. Fedor brought this up earlier when discussions were
happening on this change and I the decision was to go forward with the
change and work out the problems afterward. The easy solution is to
make torque throw runtime exceptions, but some are opposed to this. So
in order to keep fulcrum compiling I left save() throwing an Exception,
of course this does not solve the problem in all the other cases where
TorqueException is thrown.
I'll throw out this possibility in the hopes someone comes up with a
better one. All the torque generated methods are switched to
protected. And they are all prefixed with torque_ or __. These methods
can then throw TorqueException. The application developer will then
write methods in Foo that call these protected methods in BaseFoo and
they can either deal with the TorqueException there or wrap the
exception appropriately or just pass it on.
john mcnally
Daniel Rall wrote:
>
> This was the only one that I came across. Are there more? This
> sounds like a deficiency in the SecurityService, rather than a problem
> in Torque. Is there something that can be done to correct the
> SecurityService?
>
> John McNally <[EMAIL PROTECTED]> writes:
>
> > this will break the security service in fulcrum. Some torque generated
> > objects implement an interface that does not allow the save method to
> > throw a TorqueException.
> >
> > john mcnally
> >
> > [EMAIL PROTECTED] wrote:
> > >
> >> dlr 02/03/13 09:51:31
> >>
> >> Modified: src/templates/om Object.vm
> >> Log:
> >> save() should throw TorqueException, rather than vanilla Exception.
> >>
> >> Revision Changes Path
> >> 1.22 +1 -1 jakarta-turbine-torque/src/templates/om/Object.vm
> >>
> >> Index: Object.vm
> >> ===================================================================
> >> RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/Object.vm,v
> >> retrieving revision 1.21
> >> retrieving revision 1.22
> >> diff -u -u -r1.21 -r1.22
> >> --- Object.vm 2 Mar 2002 02:23:55 -0000 1.21
> >> +++ Object.vm 13 Mar 2002 17:51:31 -0000 1.22
> >> @@ -771,7 +771,7 @@
> >> * Stores the object in the database. If the object is new,
> >> * it inserts it; otherwise an update is performed.
> >> */
> >> - public void save() throws Exception
> >> + public void save() throws TorqueException
> >> {
> >> #if ($complexObjectModel)
> >> save(${table.JavaName}Peer.getMapBuilder()
> >>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>