[ 
https://issues.apache.org/jira/browse/CAY-801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036153#comment-13036153
 ] 

murali krishna commented on CAY-801:
------------------------------------

before establishing the connection to database compare the password with DB 
password,connecting to DB(on matching) else take password from the user through 
"joptionpanel"  and re-establish the database connection.

Note: This works only for MySql Database....:-(

> Re-encode DB password on connection failure
> -------------------------------------------
>
>                 Key: CAY-801
>                 URL: https://issues.apache.org/jira/browse/CAY-801
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Core Library
>    Affects Versions: 3.0
>         Environment: All
>            Reporter: Michael Gentry
>            Assignee: Michael Gentry
>            Priority: Minor
>             Fix For: Short term future
>
>
> If Cayenne tries to do a DB connection and fails (something like this):
> org.objectstyle.cayenne.access.QueryLogger  - --- will run 1 query.
> org.objectstyle.cayenne.access.QueryLogger  - Opening connection: 
> jdbc:sybase:Tds:host:port/db
>         Login: xxxxx
>         Password: *******
> org.objectstyle.cayenne.access.QueryLogger  - *** Connecting: FAILURE.
> java.sql.SQLException: JZ00L: Login failed.  Examine the SQLWarnings chained 
> to
> this exception for the reason(s).
>         at 
> com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:506)
>         at com.sybase.jdbc2.tds.Tds.processLoginAckToken(Tds.java:3248)
>         at com.sybase.jdbc2.tds.Tds.doLogin(Tds.java:483)
>         at com.sybase.jdbc2.tds.Tds.login(Tds.java:405)
>         at 
> com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java:218)
>         at 
> com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:195)
> When Cayenne tries to reconnect, it should read and encode the DB password 
> through the encoders again.  (Although this probably only makes sense if not 
> stored in the model.)  The above example occurred when the DB password 
> changed, and even though the password was stored outside the model (in an 
> external file), Cayenne has the password cached and will not re-read it to 
> obtain the new password.
> If Cayenne can re-read the password, then DB password changes can be done 
> without bringing an application server down or doing migrations.  (This 
> particular application was running from a WAR file.)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to