You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by "Thomas Vandahl (JIRA)" <ji...@apache.org> on 2005/09/15 08:58:55 UTC

[jira] Created: (TRB-5) TorqueSecurityService relies on a datasource named "default"

TorqueSecurityService relies on a datasource named "default"
------------------------------------------------------------

         Key: TRB-5
         URL: http://issues.apache.org/jira/browse/TRB-5
     Project: Turbine
        Type: Bug
  Components: Turbine 2.3  
 Environment: Turbine-2.3.2-rc2.-dev
    Reporter: Thomas Vandahl


The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
The previous version simply used the configured default DataSource as in

torque.database.default=turbine


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TRB-5?page=comments#action_12329699 ] 

Henning Schmiedehausen commented on TRB-5:
------------------------------------------

Could you please try to verify this one more time? The following configuration works for me:

--- cut --- torque.properties --- cut ---
torque.dsfactory.secdemo.connection.driver =            org.postgresql.Driver
torque.dsfactory.secdemo.connection.url =               jdbc:postgresql://localhost/secdemo
torque.dsfactory.secdemo.connection.user =              postgres
torque.dsfactory.secdemo.connection.password =

torque.database.default =               secdemo

torque.database.secdemo.adapter =       postgresql
torque.dsfactory.secdemo.factory =      org.apache.torque.dsfactory.SharedPoolDataSourceFactory

--- cut --- torque.properties --- cut ---

--- cut --- TurbineResources.properties --- cut ---
services.SecurityService.classname=org.apache.turbine.services.security.torque.TorqueSecurityService
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
--- cut --- TurbineResources.properties --- cut ---

You can test this by getting the secdemo application from http://henning.schmiedehausen.org/eyewiki/attach/TurbineSecurityExampleUsingMETA/secdemo-1.0-src.tar.gz
and removing the following lines from conf/turbine-om.properties:

services.SecurityService.torque.userPeer.class       = org.apache.turbine.app.secdemo.om.TurbineUserPeer
services.SecurityService.torque.groupPeer.class      = org.apache.turbine.app.secdemo.om.TurbineGroupPeer
services.SecurityService.torque.permissionPeer.class = org.apache.turbine.app.secdemo.om.TurbinePermissionPeer
services.SecurityService.torque.rolePeer.class       = org.apache.turbine.app.secdemo.om.TurbineRolePeer

Doing so will let the Security Service fall back to the internal, om generated classes. If I remove the line

torque.database.default =               secdemo

from the torque.properties, then it no longer works. So it seems to do the mapping correctly.

> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TRB-5?page=all ]
     
Henning Schmiedehausen resolved TRB-5:
--------------------------------------

    Resolution: Won't Fix

This is a backward compatibility issue with Torque. Torque 3.1.1 which is the current recommended version to use for Turbine works.

> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TRB-5?page=comments#action_12330107 ] 

Thomas Vandahl commented on TRB-5:
----------------------------------

I tried to debug the login request (which fails in my case) and got the following:

- The mapping of the default database is ok. TorqueInstance.getDefaultDB() returns "turbine"
- In the BaseTurbineUserPeer-class, there is the following method:

    private static void setDbName(Criteria crit)
    {
        // Set the correct dbName if it has not been overridden
        // crit.getDbName will return the same object if not set to
        // another value so == check is okay and faster
        if (crit.getDbName() == Torque.getDefaultDB())
        {
            crit.setDbName(DATABASE_NAME);
        }
    }

- As the Criteria contains the correct default database name ("turbine") the comparison is true and the databse name of the class ("default") is set in the criteria. This key, however, doesn't exist in the dsFactoryMap of TorqueInstance and we get no connection. Boom.

> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TRB-5?page=comments#action_12330120 ] 

Henning Schmiedehausen commented on TRB-5:
------------------------------------------

You are using Torque 3.2-rc2 and I use Torque 3.1.1. Turbine also uses 3.1.1 to generate the OM classes. That might be the problem. Can you try with the 3.1.1 runtime? 

If this is the problem, then IMHO it is a Torque problem, because it should be backwards compatible between the 3.1.1 release and 3.2. 

I don't intend to build the OM classes with 3.2-rc<x>, because I do want to stick to released versions for 2.3.2, which might be the last release for a longer time. 

Another thing that you can try is to build custom peer objects for an application (again, get the secdemo and just substitute the 3.1.1 for 3.2 versions) and check whether the Torque Security Service chokes on the 3.2 built peer objects.

Currently I tend to point the finger at Torque. ;-)

> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Henning Schmiedehausen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TRB-5?page=all ]

Henning Schmiedehausen reassigned TRB-5:
----------------------------------------

    Assign To: Henning Schmiedehausen

> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TRB-5?page=comments#action_12331069 ] 

Thomas Fischer commented on TRB-5:
----------------------------------

The corresponding Torque issue tracker is 
http://issues.apache.org/scarab/issues/id/TRQS322

I would consider it cleaner if either
- Turbine would define the data souce called "default" if it is needed
or
- Turbine would use Torque.getDefaultDB() to find out the name of the default data source

> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TRB-5?page=comments#action_12330104 ] 

Thomas Vandahl commented on TRB-5:
----------------------------------

This configuration doesn't work for me.

The application tries to connect to a default datasource which it didn't do before. The typical error message for something like this in the Torque-log is:
---
2005-09-21 17:40:42,930 [main] WARN  org.apache.torque.oid.IDBroker - IDBroker is being used with db 'default', which does not support transactions. IDBroker attempts to use transactions to limit the possibility of duplicate key generation.  Without transactions, duplicate key generation is possible if multiple JVMs are used or other means are used to write to the database.
---
This usually means connection problems with a database. Another hint that something strange is going on: I've got two ID-Broker threads running where one should suffice. 

I use a JNDI DataSource with mysql. 
Which version of Torque are you using? I have the latest 3.2-rc2.


> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TRB-5) TorqueSecurityService relies on a datasource named "default"

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TRB-5?page=comments#action_12330171 ] 

Thomas Vandahl commented on TRB-5:
----------------------------------

Right you are:

---8<---
Filename: db/torque/trunk/src/java/org/apache/torque/TorqueInstance.java
Revision 229755 - (view) (download) (as text) - [select for diffs]
Modified Fri Jul 8 17:53:34 2005 UTC (2 months, 2 weeks ago) by tfischer
File length: 29281 byte(s)
Diff to previous 229745 (colored)

Updated runtime configuration process to do stricter checking, and removed the automatic configuration of the DataSourceFactory with the name "default".
See xdocs/changes.xml for details. Solves issue TRQS308.
---8<---

I will open an issue in the Torque bugtracker

> TorqueSecurityService relies on a datasource named "default"
> ------------------------------------------------------------
>
>          Key: TRB-5
>          URL: http://issues.apache.org/jira/browse/TRB-5
>      Project: Turbine
>         Type: Bug
>   Components: Turbine 2.3
>  Environment: Turbine-2.3.2-rc2.-dev
>     Reporter: Thomas Vandahl
>     Assignee: Henning Schmiedehausen

>
> The OM-classes generated during the build process of Turbine need a hard-coded data source called "default".
> The previous version simply used the configured default DataSource as in
> torque.database.default=turbine

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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