Results 1 to 7 of 7

Thread: app instance hangs on mysql connect error

  1. #1

    Default app instance hangs on mysql connect error

    Hello

    i've got a weird error since i upgraded from wowza2 to wowza3:

    i'm maintaining a connection db with mysql connector 5: database is updated when users disconnect and save time of disconnection.

    until now i didn't had problems with this even if the mysql connection was wrong. now i've got the following behavior: when a use disconnects, the room hangs for all users (streams stops instantly), and it is impossible to reconnect to the same instance. on the other hand, it is still possible to reconnect to the same server, same app, but different instance.

    the error logs show this:

    Last packet sent to the server was 0 ms ago.
    ERROR   server  comment 2012-03-22      14:48:46        -       -       -       -       -       1413816.483     -       -       -       -       -       -       -       -       com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
    
    Last packet sent to the server was 0 ms ago.
    - so i believe that fixing the mysql error would fix the problem, but still this behavior seems a bit weird and there might be a workaround on the wowza side since:

    - this behavior wasn't present previsously

    thank you very much for you help and advices

    Gabriel

  2. #2

    Default

    up

  3. #3
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Take a look at how a JDBC connection is established and handled in this example:

    http://www.wowza.com/forums/content....Authentication

    Make sure you have the same try/catch blocks.

    Richard

  4. #4

    Default

    hi Richard thanks for your reply

    i know how to handle mysql connections, but my remark is i find it's weird that the whole instance hangs (it means sharedobjects and streams) just because there is a mysql connection errro (which is, by the way, handled in the code). this behavior wasn't existing in the 2 version (i had same errors sometimes when changing servers and/or wrong mysql user/password, but only logs errors, not system crash) this is why i'm wondering if in some way this is "normal behavior" (i mean, a mysql connection error shouldn't causes streams/SO crash)...

    but thanks anyway for your attention about this matter

    Gabriel

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Some error is not handled in your JDBC setup, that is what that means. You have to review error handling in the JDBC code.

    Richard

  6. #6

    Default

    sorry but it is:

    try
    {
    conn = DriverManager.getConnection("jdbc:mysql://xxxx:3306/my_db?user=xxxx&password=xxxx");
    getLogger().info("conn"+conn);
    }

    catch (Exception e)
    {
    getLogger().error(e.toString());
    }
    the line "getLogger().error(e.toString());" is where the connection error is displayed...or tell me if this is not a correct error handling and if my code is wrong

    thank you

    Gabriel

  7. #7

    Default

    The example Richard last mentioned had this:
    catch (SQLException ex) 
    		{
    			// handle any errors
    			System.out.println("SQLException: " + ex.getMessage());
    			System.out.println("SQLState: " + ex.getSQLState());
    			System.out.println("VendorError: " + ex.getErrorCode());
    		}
    Just a guess but, maybe toString() doesn't work on the SQLException object and your exception handler has a runtime error. Check the SQLException methods in the Java docs.
    Last edited by randall; 03-24-2012 at 01:53 PM.

Similar Threads

  1. Shutdown app instance
    By Steve1980 in forum General Forum
    Replies: 3
    Last Post: 10-07-2013, 12:57 PM
  2. Replies: 2
    Last Post: 10-07-2013, 08:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •