Changeset 1577


Ignore:
Timestamp:
Feb 28, 2011, 6:04:45 PM (6 years ago)
Author:
robert@…
Message:

Resolved problems with module communication

Location:
trunk/grails-app/services/dbnp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/services/dbnp/authentication/AuthenticationService.groovy

    r1455 r1577  
    4444     */
    4545    public boolean logInRemotely( String consumer, String token, SecUser user ) {
    46         // Make sure there is no other logged in user anymore
     46                // Remove expired users, otherwise they will be kept in the database forever
     47                removeExpiredTokens()
     48
     49                // Make sure there is no other logged in user anymore
    4750        logOffRemotely( consumer, token )
    4851
     
    6871     */
    6972    public boolean isRemotelyLoggedIn( String consumer, String token ) {
    70         // Remove expired users, otherwise they will be kept in the database forever
    71         removeExpiredTokens()
    72 
    7373        // Check whether a user exists
    7474        def user = getSessionAuthenticatedUser(consumer, token)
     
    9090     */
    9191    public SecUser getRemotelyLoggedInUser( String consumer, String token ) {
    92         // Remove expired users, otherwise they will be kept in the database forever
    93         removeExpiredTokens()
    94 
    9592        // Check whether a user exists
    9693        def user = getSessionAuthenticatedUser(consumer, token)
  • trunk/grails-app/services/dbnp/modules/ModuleCommunicationService.groovy

    r1576 r1577  
    101101
    102102                // put the session token to work
    103                 // This saving is done in a separate session, since that seems to be the only way to have grails/hibernate
    104                 // really save the object to the database. This is needed, since the module will start a new http request to GSCF
    105                 // and in that request the database object must exist.
    106                 // Using session.flush(), save(flush:true) or transaction.commit() don't do the trick. If you know
    107                 // a better way to perform this trick, feel free to change it :)
    108                 def hibernateSession = sessionFactory.openSession( sessionFactory.getCurrentSession().connection() );
    109                 def transaction = hibernateSession.beginTransaction();
    110                
    111                 if( transaction ) {
    112                         authenticationService.logInRemotely( consumer, sessionToken, authenticationService.getLoggedInUser() )
    113                         transaction.commit();
    114                 }
    115                 hibernateSession.flush();
     103                authenticationService.logInRemotely( consumer, sessionToken, authenticationService.getLoggedInUser() )
    116104               
    117105                // Append the sessionToken to the URL
  • trunk/grails-app/services/dbnp/studycapturing/AssayService.groovy

    r1559 r1577  
    1919class AssayService {
    2020
    21     boolean transactional = true
     21    boolean transactional = false
    2222    def authenticationService
    2323    def moduleCommunicationService
Note: See TracChangeset for help on using the changeset viewer.