Forum Discussion

wwilbur's avatar
wwilbur
Occasional Contributor
4 years ago
Solved

ERROR: org.postgresql.util.PSQLException: FATAL: too many connections

I have closed all connections to the Postgresql database, closed all apps connecting to it, rebooted my computer and still get the above message. This has happened many times for the Postgresql databases. Is there a way to fix. I do not have admin to increase connections so need to find a way to make sure all connections are closed before starting script

 

  • Finally I write a script to Click on nested Menu that is not recognized with TC-Engine.

     

            def SelectContextMenueStrip(cls, Contain_0 = '', Contain_1 = ''):
        
                    try:
            
                            Index_0 = 0
                            Index_1 = 0
                            Delay(50)
    
                            ContextMenuStrip = Aliases.JTL_Wawi.ContextMenuStrip
                    
                            Height = ContextMenuStrip.Height
                            Width = ContextMenuStrip.Width
                            Count = ContextMenuStrip.get_Items().Count
                            IndividualHeight = Height / Count
        
                            for Index_0 in range(0,Count,1):
                                    Item = ContextMenuStrip.GetItemAt(Width/2, IndividualHeight * Index_0 )
                                    if Item != None:
                                            if ContextMenuStrip.GetItemAt(Width/2, IndividualHeight * Index_0 ).Text.OleValue == Contain_0:
                                                    ContextMenuStrip.Click(Width/2, IndividualHeight * Index_0) 
                                                     
                                                    if Contain_1 != '':
                                                            ContextMenuStrip_1 = Aliases.JTL_Wawi.ContextMenuStrip.activeDropDowns_2.Item[0]
                                                            
                                                            Height_1 = ContextMenuStrip_1.Height
                                                            Width_1 = ContextMenuStrip_1.Width
                                                            Count_1 = ContextMenuStrip_1.get_Items().Count
                                                            IndividualHeight_1 = Height_1 / Count_1  
                                                            
                                                            for Index_1 in range(0,Count_1,1):
                                                                    Item_1 = ContextMenuStrip_1.GetItemAt(Width_1/2, IndividualHeight_1 * Index_1 )
                                                                    
                                                                    if Item_1 != None:
                                                                            if ContextMenuStrip_1.GetItemAt(Width_1/2, IndividualHeight_1 * Index_1 ).Text.OleValue == Contain_1:
                                                                                    MouseX = ContextMenuStrip_1.Left
                                                                                    MouseY = ContextMenuStrip_1.Top
                                                                                    Sys.Desktop.MouseDown(VK_LBUTTON , MouseX + Width_1/2, MouseY + IndividualHeight_1 * Index_1)
                                                                                    Sys.Desktop.MouseUp(VK_LBUTTON , MouseX + Width_1/2, MouseY + IndividualHeight_1 * Index_1)
                                                            Index_1 += 1
                                    Index_0 += 1
                                                                
                            
                    except Exception as exp:
                            Log.Message('SelectContextMenueStrip - type:' + str(exp)) 

     

     

    I use mouse position to click on desktop, Enjoy it 😉

     

5 Replies

    • wwilbur's avatar
      wwilbur
      Occasional Contributor

      I tried this but it did not work, thank you for replying

      • richie's avatar
        richie
        Community Hero
        Hey wwilbur,

        The info on the stackoverflow page (the query) should work as the table holds a list of all the connections. Can you clarify exactly what you did and what occurred when you tried? Cos killing that pid works.

        Ive re-read your description again and im guessing that keeping active connections in the pool is an issue with postgresql, so theres not much you can do from the other end of things (ReadyAPI) to resolve. This is NOT an issue with ReadyAPI, so the resolution at best is gonna be running a query or a kill command in the OS or something similar. This issue would occur whatever application was hitting the database. Thats where you need to resolve the issue, im thinking

        Cheers

        Rich