You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Bartek Walter <Ba...@man.poznan.pl> on 2005/03/10 09:30:49 UTC

Torque Security idMethod switches from native to idbroker

hello,

I got a problem, possibly with a trivial solution, but I stuck in it and 
cannot get out:
I use TorqueSecuritySchema and I modified the 
turbine-security-schema.xml to use the 'native' idMethod. The method is 
defined both at the database and tables level:

<database name="foo"
   defaultIdMethod="native"
   defaultJavaType="primitive"
   defaultJavaNamingMethod="underscore"
   package="@DATABASE_PACKAGE@">

   <table name="TURBINE_USER" idMethod="native">
    ...
   </table>
</database>

The Peers and TableMapBuilders are generated correctly, ie. with 
'native' as primary key method, also .sql files contain sequence 
definitions (I use Oracle).

The problem is that the application uses idbroker instead of native. The 
DatabaseMap is initialized with TableMapBuilders (their isBuild() 
methods return 'true' also) , but with wrong primary key method settings 
('idbroker', incorrect sequence name). It is strange, since the default 
value for idMethod is 'none', so that the TableMapBuilder must have been 
built before.

After manual adjusting the values by manipulating on DatabaseMap prior 
to executing any insert to the TURBINE_USER table, Torque begins to use 
natives.

The security schema and application schemas reside in separate files, 
but they share a common database name. I use TorqueUser as 
implementation object, and Torque-generated peer/entity objects.

Any idea what the problem could be?

Best regards,
-- 
Bartosz Walter


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


temp files from turbine

Posted by al...@t-online.de.
Previous posting went into the wrong thread sorry:) here we are again...

Hi all,

Is it normal behavior that the upload service leaves behind temporary files
likes this one after successfully uploading an image?

	78E68CAC03D8554042EDC1825483FD8C_upload_00000000.tmp

If it is normal behavior, how do I get rid of them ? Automatically ?
If not normal behavior, what has gone wrong ?

Rgds
albi



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Torque Security idMethod switches from native to idbroker - solution and lessons learned

Posted by al...@t-online.de.
Hi all,

Is it normal behavior that the upload service leaves behind temporary files
likes this one after successfully uploading an image?

	78E68CAC03D8554042EDC1825483FD8C_upload_00000000.tmp

If it is normal behavior, how do I get rid of them ? Automatically ?
If not normal behavior, what has gone wrong ?

Rgds
albi



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Torque Security idMethod switches from native to idbroker - solution and lessons learned

Posted by Bartek Walter <Ba...@man.poznan.pl>.
Bartek Walter wrote:
> Paulo Schlup Santos wrote:
> 
>> Hi Bartek,
> 
> 
> Paulo thank you again for the answer, unfortunately it still does not help.
> 
>> I have seen something like this happen in PostgreSQL, but on Oracle 
>> it's working just fine for us. Did you try cleaning your target 
>> directory with "maven clean" and building your app again? I've found 
>> out that it solves many problems with inconsistencies among torque 
>> classes.
> 
> 
> Certainly I tried, several times. No result, unfortunately...
> 
>> The only other thing I can tell you is that we have put tne 
>> idMethod="true" on both dataset and table xml tags, and that the 
>> uppercase "M" *does* matter in the "idMethod" keyword. Also, the 
>> keywords "autoIncrement" and "primaryKey" should be type exactly as 
>> I've put below, with capital "I" and "K" respectively.
> 
> 
> I am sure my schema is correct, since the Peers and MapBuilders for 
> SecurityService are generated correctly (with 'native' idMethods set).
> 
> It is important that the problem concerns only the security-related 
> objects, which suggests that prior to registering TableMaps generated by 
> Torque, the o.a.t.util.db.map.TurbineTableMap (a TableMap for 
> DBSecurityService) is invoked, which registers all security-related 
> tables with 'idbroker'.

Finally I've found the bug. It was my negligence: I adopted an old Flux 
plugin, dating back to T2.1, to T2.3. It is quite easy to make it 
working, but I omitted a single constant from 
o.a.t.om.security.peer.TurbineUserPeer, which makes a classloader to 
load the class, initialize all its static fields (with MAP_BUILDER!), 
and subsequently override DatabaseMap entries with DBSecurityService 
specific solutions. Instead, the o.a.t.om.security.User constants should 
be used.

With best regards,
-- 
Bartosz Walter

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Torque Security idMethod switches from native to idbroker

Posted by Bartek Walter <Ba...@man.poznan.pl>.
Paulo Schlup Santos wrote:
> Hi Bartek,

Paulo thank you again for the answer, unfortunately it still does not help.

> I have seen something like this happen in PostgreSQL, but on Oracle it's 
> working just fine for us. Did you try cleaning your target directory 
> with "maven clean" and building your app again? I've found out that it 
> solves many problems with inconsistencies among torque classes.

Certainly I tried, several times. No result, unfortunately...

> The only other thing I can tell you is that we have put tne 
> idMethod="true" on both dataset and table xml tags, and that the 
> uppercase "M" *does* matter in the "idMethod" keyword. Also, the 
> keywords "autoIncrement" and "primaryKey" should be type exactly as I've 
> put below, with capital "I" and "K" respectively.

I am sure my schema is correct, since the Peers and MapBuilders for 
SecurityService are generated correctly (with 'native' idMethods set).

It is important that the problem concerns only the security-related 
objects, which suggests that prior to registering TableMaps generated by 
Torque, the o.a.t.util.db.map.TurbineTableMap (a TableMap for 
DBSecurityService) is invoked, which registers all security-related 
tables with 'idbroker'.

My TR.props related to security service entries are as follows:

services.SecurityService.classname = 
org.apache.turbine.services.security.torque.TorqueSecurityService
services.SecurityService.acl.class = 
org.apache.turbine.util.security.TurbineAccessControlList
services.SecurityService.secure.passwords=false
services.SecurityService.secure.passwords.algorithm=SHA
services.SecurityService.user.manager = 
org.apache.turbine.services.security.torque.TorqueUserManager

services.SecurityService.user.class = 
org.apache.turbine.services.security.torque.TorqueUser
services.SecurityService.group.class = 
org.apache.turbine.services.security.torque.TorqueGroup
services.SecurityService.permission.class = 
org.apache.turbine.services.security.torque.TorquePermission
services.SecurityService.role.class = 
org.apache.turbine.services.security.torque.TorqueRole

services.SecurityService.torque.userPeer.class       = 
foo.package.TurbineUserPeer
services.SecurityService.torque.groupPeer.class      = 
foo.package.TurbineGroupPeer
services.SecurityService.torque.permissionPeer.class = 
foo.package.TurbinePermissionPeer
services.SecurityService.torque.rolePeer.class       = 
foo.package.TurbineRolePeer

# following are not necessary, but I added them
services.SecurityService.torque.user.class       = foo.package.TurbineUser
services.SecurityService.torque.group.class      = foo.package.TurbineGroup
services.SecurityService.torque.permission.class = 
foo.package.TurbinePermission
services.SecurityService.torque.role.class       = foo.package.TurbineRole

AFAIK all properties are defined properly (according to the 
TorqueSecurityService how-to), and the runtime checks I made also show 
configuration

If anyone has an idea on what may be wrong, please let me know.

Thanks in advance,
Bartek


> Bartek Walter wrote:
> 
>> Paulo Schlup Santos wrote:
>>
>>> Hi Bartek,
>>>
>>> I have found out that you also need to add the statement 
>>> "autoIncrement=true" to the primary key column for the *native* id 
>>> method to work. Below is an example extracted from our schema file:
>>>
>>> <column name="CLIENTE_ID" required="true" autoIncrement="true" 
>>> primaryKey="true" type="INTEGER"/>
>>>
>>> This project uses Oracle 9i as a database and the auto-increment 
>>> columns work just fine with the above line, with no modifications to 
>>> the mapping classes whatsoever.
>>
>>
>>
>> Thank you, Paulo, very much.
>>
>> Unfortunately your advice seem not to be working for me :( It seems to 
>> me that autoIncrement attribute turns on and off generation of PKs, 
>> but it does not switch the idMethods (but perhaps I am wrong - did you 
>> encounter such behavior?).
>>
>> Even if I set up the 'native' idMethod in the schema, the application 
>> uses idbroker (and IDs get incremented properly, but from ID_TABLE). I 
>> checked the databaseMap at runtime, and all tables are registerd 
>> there, but with improper idMethod data.
>>
>> On one hand it seems that *MapBuilder.doBuild() methods get called 
>> (somhow the databaseMap is initialized with 'idbroker'), but on the 
>> other I have to call them manually within the application to set 
>> 'natives', just like if it loaded other MapBuilders(). I still have no 
>> idea what the reason could be for that.
>>
>> Did you change any Turbine settings?
>>
>> Best regards,
>> Bartek
>>
>>>
>>> Bartek Walter wrote:
>>>
>>>>
>>>> hello,
>>>>
>>>> I got a problem, possibly with a trivial solution, but I stuck in it 
>>>> and cannot get out:
>>>> I use TorqueSecuritySchema and I modified the 
>>>> turbine-security-schema.xml to use the 'native' idMethod. The method 
>>>> is defined both at the database and tables level:
>>>>
>>>> <database name="foo"
>>>>   defaultIdMethod="native"
>>>>   defaultJavaType="primitive"
>>>>   defaultJavaNamingMethod="underscore"
>>>>   package="@DATABASE_PACKAGE@">
>>>>
>>>>   <table name="TURBINE_USER" idMethod="native">
>>>>    ...
>>>>   </table>
>>>> </database>
>>>>
>>>> The Peers and TableMapBuilders are generated correctly, ie. with 
>>>> 'native' as primary key method, also .sql files contain sequence 
>>>> definitions (I use Oracle).
>>>>
>>>> The problem is that the application uses idbroker instead of native. 
>>>> The DatabaseMap is initialized with TableMapBuilders (their 
>>>> isBuild() methods return 'true' also) , but with wrong primary key 
>>>> method settings ('idbroker', incorrect sequence name). It is 
>>>> strange, since the default value for idMethod is 'none', so that the 
>>>> TableMapBuilder must have been built before.
>>>>
>>>> After manual adjusting the values by manipulating on DatabaseMap 
>>>> prior to executing any insert to the TURBINE_USER table, Torque 
>>>> begins to use natives.
>>>>
>>>> The security schema and application schemas reside in separate 
>>>> files, but they share a common database name. I use TorqueUser as 
>>>> implementation object, and Torque-generated peer/entity objects.
>>>>
>>>> Any idea what the problem could be?
>>>>
>>>> Best regards,
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>>
>>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 


-- 
Bartosz Walter
Institute of Computing Science
Poznan University of Technology, Poland

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Torque Security idMethod switches from native to idbroker

Posted by Paulo Schlup Santos <pa...@isnet.com.br>.
Hi Bartek,

I have seen something like this happen in PostgreSQL, but on Oracle it's 
working just fine for us. Did you try cleaning your target directory 
with "maven clean" and building your app again? I've found out that it 
solves many problems with inconsistencies among torque classes.

The only other thing I can tell you is that we have put tne 
idMethod="true" on both dataset and table xml tags, and that the 
uppercase "M" *does* matter in the "idMethod" keyword. Also, the 
keywords "autoIncrement" and "primaryKey" should be type exactly as I've 
put below, with capital "I" and "K" respectively.

Best Regards,
Paulo Schlup Santos
Wiaxis.com mobile solutions

Bartek Walter wrote:

> Paulo Schlup Santos wrote:
>
>> Hi Bartek,
>>
>> I have found out that you also need to add the statement 
>> "autoIncrement=true" to the primary key column for the *native* id 
>> method to work. Below is an example extracted from our schema file:
>>
>> <column name="CLIENTE_ID" required="true" autoIncrement="true" 
>> primaryKey="true" type="INTEGER"/>
>>
>> This project uses Oracle 9i as a database and the auto-increment 
>> columns work just fine with the above line, with no modifications to 
>> the mapping classes whatsoever.
>
>
> Thank you, Paulo, very much.
>
> Unfortunately your advice seem not to be working for me :( It seems to 
> me that autoIncrement attribute turns on and off generation of PKs, 
> but it does not switch the idMethods (but perhaps I am wrong - did you 
> encounter such behavior?).
>
> Even if I set up the 'native' idMethod in the schema, the application 
> uses idbroker (and IDs get incremented properly, but from ID_TABLE). I 
> checked the databaseMap at runtime, and all tables are registerd 
> there, but with improper idMethod data.
>
> On one hand it seems that *MapBuilder.doBuild() methods get called 
> (somhow the databaseMap is initialized with 'idbroker'), but on the 
> other I have to call them manually within the application to set 
> 'natives', just like if it loaded other MapBuilders(). I still have no 
> idea what the reason could be for that.
>
> Did you change any Turbine settings?
>
> Best regards,
> Bartek
>
>>
>> Bartek Walter wrote:
>>
>>>
>>> hello,
>>>
>>> I got a problem, possibly with a trivial solution, but I stuck in it 
>>> and cannot get out:
>>> I use TorqueSecuritySchema and I modified the 
>>> turbine-security-schema.xml to use the 'native' idMethod. The method 
>>> is defined both at the database and tables level:
>>>
>>> <database name="foo"
>>>   defaultIdMethod="native"
>>>   defaultJavaType="primitive"
>>>   defaultJavaNamingMethod="underscore"
>>>   package="@DATABASE_PACKAGE@">
>>>
>>>   <table name="TURBINE_USER" idMethod="native">
>>>    ...
>>>   </table>
>>> </database>
>>>
>>> The Peers and TableMapBuilders are generated correctly, ie. with 
>>> 'native' as primary key method, also .sql files contain sequence 
>>> definitions (I use Oracle).
>>>
>>> The problem is that the application uses idbroker instead of native. 
>>> The DatabaseMap is initialized with TableMapBuilders (their 
>>> isBuild() methods return 'true' also) , but with wrong primary key 
>>> method settings ('idbroker', incorrect sequence name). It is 
>>> strange, since the default value for idMethod is 'none', so that the 
>>> TableMapBuilder must have been built before.
>>>
>>> After manual adjusting the values by manipulating on DatabaseMap 
>>> prior to executing any insert to the TURBINE_USER table, Torque 
>>> begins to use natives.
>>>
>>> The security schema and application schemas reside in separate 
>>> files, but they share a common database name. I use TorqueUser as 
>>> implementation object, and Torque-generated peer/entity objects.
>>>
>>> Any idea what the problem could be?
>>>
>>> Best regards,
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>>
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Torque Security idMethod switches from native to idbroker

Posted by Bartek Walter <Ba...@man.poznan.pl>.
Paulo Schlup Santos wrote:
> Hi Bartek,
> 
> I have found out that you also need to add the statement 
> "autoIncrement=true" to the primary key column for the *native* id 
> method to work. Below is an example extracted from our schema file:
> 
> <column name="CLIENTE_ID" required="true" autoIncrement="true" 
> primaryKey="true" type="INTEGER"/>
> 
> This project uses Oracle 9i as a database and the auto-increment columns 
> work just fine with the above line, with no modifications to the mapping 
> classes whatsoever.

Thank you, Paulo, very much.

Unfortunately your advice seem not to be working for me :( It seems to 
me that autoIncrement attribute turns on and off generation of PKs, but 
it does not switch the idMethods (but perhaps I am wrong - did you 
encounter such behavior?).

Even if I set up the 'native' idMethod in the schema, the application 
uses idbroker (and IDs get incremented properly, but from ID_TABLE). I 
checked the databaseMap at runtime, and all tables are registerd there, 
but with improper idMethod data.

On one hand it seems that *MapBuilder.doBuild() methods get called 
(somhow the databaseMap is initialized with 'idbroker'), but on the 
other I have to call them manually within the application to set 
'natives', just like if it loaded other MapBuilders(). I still have no 
idea what the reason could be for that.

Did you change any Turbine settings?

Best regards,
Bartek

> 
> Bartek Walter wrote:
> 
>>
>> hello,
>>
>> I got a problem, possibly with a trivial solution, but I stuck in it 
>> and cannot get out:
>> I use TorqueSecuritySchema and I modified the 
>> turbine-security-schema.xml to use the 'native' idMethod. The method 
>> is defined both at the database and tables level:
>>
>> <database name="foo"
>>   defaultIdMethod="native"
>>   defaultJavaType="primitive"
>>   defaultJavaNamingMethod="underscore"
>>   package="@DATABASE_PACKAGE@">
>>
>>   <table name="TURBINE_USER" idMethod="native">
>>    ...
>>   </table>
>> </database>
>>
>> The Peers and TableMapBuilders are generated correctly, ie. with 
>> 'native' as primary key method, also .sql files contain sequence 
>> definitions (I use Oracle).
>>
>> The problem is that the application uses idbroker instead of native. 
>> The DatabaseMap is initialized with TableMapBuilders (their isBuild() 
>> methods return 'true' also) , but with wrong primary key method 
>> settings ('idbroker', incorrect sequence name). It is strange, since 
>> the default value for idMethod is 'none', so that the TableMapBuilder 
>> must have been built before.
>>
>> After manual adjusting the values by manipulating on DatabaseMap prior 
>> to executing any insert to the TURBINE_USER table, Torque begins to 
>> use natives.
>>
>> The security schema and application schemas reside in separate files, 
>> but they share a common database name. I use TorqueUser as 
>> implementation object, and Torque-generated peer/entity objects.
>>
>> Any idea what the problem could be?
>>
>> Best regards,
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 
> 


-- 
Bartosz Walter
Institute of Computing Science
Poznan University of Technology, Poland

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Torque Security idMethod switches from native to idbroker

Posted by Paulo Schlup Santos <pa...@isnet.com.br>.
Hi Bartek,

I have found out that you also need to add the statement 
"autoIncrement=true" to the primary key column for the *native* id 
method to work. Below is an example extracted from our schema file:

<column name="CLIENTE_ID" required="true" autoIncrement="true" 
primaryKey="true" type="INTEGER"/>

This project uses Oracle 9i as a database and the auto-increment columns 
work just fine with the above line, with no modifications to the mapping 
classes whatsoever.

Best regards,
Paulo Schlup Santos
www.wiaxis.com Mobile Solutions


Bartek Walter wrote:

>
> hello,
>
> I got a problem, possibly with a trivial solution, but I stuck in it 
> and cannot get out:
> I use TorqueSecuritySchema and I modified the 
> turbine-security-schema.xml to use the 'native' idMethod. The method 
> is defined both at the database and tables level:
>
> <database name="foo"
>   defaultIdMethod="native"
>   defaultJavaType="primitive"
>   defaultJavaNamingMethod="underscore"
>   package="@DATABASE_PACKAGE@">
>
>   <table name="TURBINE_USER" idMethod="native">
>    ...
>   </table>
> </database>
>
> The Peers and TableMapBuilders are generated correctly, ie. with 
> 'native' as primary key method, also .sql files contain sequence 
> definitions (I use Oracle).
>
> The problem is that the application uses idbroker instead of native. 
> The DatabaseMap is initialized with TableMapBuilders (their isBuild() 
> methods return 'true' also) , but with wrong primary key method 
> settings ('idbroker', incorrect sequence name). It is strange, since 
> the default value for idMethod is 'none', so that the TableMapBuilder 
> must have been built before.
>
> After manual adjusting the values by manipulating on DatabaseMap prior 
> to executing any insert to the TURBINE_USER table, Torque begins to 
> use natives.
>
> The security schema and application schemas reside in separate files, 
> but they share a common database name. I use TorqueUser as 
> implementation object, and Torque-generated peer/entity objects.
>
> Any idea what the problem could be?
>
> Best regards,



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org