Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-129

Script Runner Behaviour script database connection pool issue

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Major
    • Resolution: Support Request
    • Affects Version/s: 3.0.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Test environment over Jira 6.3.15

    • Critical Points:
      0

      Description

      Hi,

      We are using script runner plugin long ago over Jira 4.4.4, now we are migrationg to Jira 6.3.15 and till using Script Runner, used for execute groovy scripts on behaviour ways. But when using our database connection goes through the roof being monitoring by Jira database monitoring. After some minutes the pool retunr to normal.

      We are executing the follow code.

      import com.atlassian.jira.project.ProjectManager
      import com.atlassian.jira.ComponentManager
      import groovy.sql.Sql
      import java.sql.Connection
      import org.ofbiz.core.entity.ConnectionFactory
      import org.ofbiz.core.entity.DelegatorInterface

      public class ServiceDeskESValues extends FieldBehaviours {
      ComponentManager componentManager = ComponentManager.getInstance()

      static sql = null

      ........................

      public ServiceDeskESValues()

      { ComponentManager componentManager = ComponentManager.getInstance() delegator = (DelegatorInterface) componentManager.getComponentInstanceOfType(DelegatorInterface.class) String helperName = delegator.getGroupHelperName("default"); Connection conn = ConnectionFactory.getConnection(helperName); sql = new Sql(conn) }

      public void setDefaultValues() {
      try{
      // Compose summary text
      def summaryText = title.getFormValue()

      if (summaryText!=null){
      System.out.println (" Por summaryText!= null $summaryText")
      if((summaryText.contains(systemName.getFormValue())==false) && (systemName.getFormValue() != "")){System.out.println ("Contains ${summaryText.contains(systemName.getFormValue())} -> ${systemName.getFormValue()}");summaryText = "(" + systemName.getFormValue() + ") ->" + title.getFormValue()
      }else

      {summaryText = summaryText + " " + title.getFormValue()}

      }

      summary.setFormValue(summaryText)
      System.out.println ("summaryText $summaryText")

      if (description.getFormValue() == "")

      {description.setFormValue("")}

      }finally

      { //sql.close() conn.close() } }

        Attachments

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            rcabrera Rubén Cabrera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: