Announcement

Collapse
No announcement yet.

sc_begin_trans/ sc_commit_trans (transactions) giving errors

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • sc_begin_trans/ sc_commit_trans (transactions) giving errors

    Hello,

    When I use these macros in my form app, I always get the following error message:

    "ERROR: undefined property [my form's name]_ini::$nm_bases_access in_array() expects parameter 2 to be array, null given"

    My "begin" is in the onvalidate whilst the "commit" is in the OnInsert/ OnDelete events. SC support says this is ok and seem to indicate this is an environmental problem. However I have tried new SC installations on fresh 3 different machines (2 Windows 7 and 1 Linux) all giving the same problem. My dbase is MySQL 5.x.

    Has anyone encountered this? I would appreciate knowing how you solved it.

    Thank you

  • #2
    Hello,

    What statements are you performing on this transaction?

    for instance:
    Code:
    onValidate():
      sc_begin_trans();
      sc_exec_sql("DELETE FROM MyTable WHERE Id =" {id}");
    
    onDelete():
      sc_commit_trans();
    regards,
    Bernhard Bernsmann

    Comment


    • #3
      @Bernhard:

      Thank you. There are a whole bunch of statements between the "begin" and "commit", spread across the two events. These statements are not only database macros as you illustrated but also if...else, etc etc. The only exception is that there is no other transactional macro in between. Do you want me to list the specifics?

      Also my connection info uses the "Transactional" MySQL option.

      Strange thing is SC support took my code and ran it unchanged at their end without getting this error. When I ran their deployment, it worked here without errors. However when I import the code exported from their system (my unchanged code) the error pops up again.

      Would appreciate any pointers.

      Comment


      • #4
        Hello,

        That is very odd. Do you use SC's transactional macros on any other application? If yes, does the error occurs?

        It could be something related to that specific application. You could try to create a new application, copy all the code related to transactions, to see if the issue happens.

        Also next time when you deploy the project, remember to clear SC temporary folder (/scriptcase/tmp) to make sure your deployment isn't affected by your former deployments.

        regards,
        Bernhard Bernsmann

        Comment


        • #5
          No its my first foray into transactional macros and I'm relatively new to SC.

          Clearing the temp folder makes no difference (besides this error occurs when running from dev environment too.)

          Are there any specific statements that are not permitted between begin....commit?
          My use of commit does not test for any conditions: is that a problem?
          The MySQL is set to auto-commit=on (by default). Is auto-commit=off required for transaction use?

          Thank you

          Comment


          • #6
            Originally posted by scriptcaser View Post
            No its my first foray into transactional macros and I'm relatively new to SC.

            Clearing the temp folder makes no difference (besides this error occurs when running from dev environment too.)

            Are there any specific statements that are not permitted between begin....commit?
            My use of commit does not test for any conditions: is that a problem?
            The MySQL is set to auto-commit=on (by default). Is auto-commit=off required for transaction use?

            Thank you
            Well starting the commit without testing any conditions shouldn't cause that.

            I don't think the MySQL setting is causing the issue. I will have to ask support about that.

            edit: Corrected that.

            regards,
            Bernhard Bernsmann

            Comment


            • #7
              Hi , I have exactly the same problem.I had the same tests with the same results.

              If I use sc_begin_trans(); for example in onbeforeinsert or onvalidate event in a form application and use sc_commit_trans(); in onafterinsert event , I have the same message.

              there is a solution ?

              Comment


              • #8
                Hello Vivon,

                Please contact our support regarding this issue. Our chat is active on workdays from 8:00am to 6:00pm (GMT -3), and our ticket system is always available.

                regards,
                Bernhard Bernsmann

                Comment

                Working...
                X