0 Replies Latest reply on Jun 25, 2007 11:19 AM by ricardomarques

    setting user data

    ricardomarques

      Hi

      I'm trying to set a user password, but for some reason. the data don't get saved. I'm wondering if i'm using this the correct way. Here's my code:

      public void changePassword(String name, String newPassword) {
      
       User user = identitySession.getUserByName(name);
      
       if (user != null) {
       user.setPassword(newPassword);
      
       identitySession.saveUser(user);
       log.debug("password changed for " + name);
       }
       else {
       log.error("no such user: " + name);
       }
      
       }
      


      I've tried also without the saveUser() and the result is the same.

      I'm opening and closing the session like this:

       public void openSession() {
       this.jbpmContext = this.jbpmConfiguration.createJbpmContext();
       this.identitySession = new IdentitySession(jbpmContext.getSession());
       log.debug("session opened!");
       }
      
       public void closeSession() {
      
       this.identitySession.close();
       this.jbpmContext = null;
      
       log.debug("session closed!");
       }
      


      Help?

      I'm using jbpm 3.2 + jboss AS 4.0.5 + mysql 5

      Thanks :)