Forum Discussion

Roxit_Support's avatar
New Contributor
11 years ago

[Resolved] commit my delete statement in JDBC step

when i run my JDBC steps with content like:
"delete from domain_object where id in (select id from zaak where extern_zaaknummer = :extern)"

the records are still available. When i run the queries straight on the DB AND add a commit statement the records are deleted.

However when I add a new line with 'commit' to the query in my JDBC step, SOAP returns an error:" ORA-00933: SQL command not properly ended"
I also tried 'go', 'submit' however the same error returns.
Adding ";" does not work either because it is JDBC, it then returns the error: "ORA-00911 invalid character"

How can I send a comitted delete statement to my Oracle 11 DB??

7 Replies

  • SiKing's avatar
    Community Expert
    I always had to run the commit in a separate JDBC step, immediately following the delete.
  • SmartBear_Suppo's avatar
    SmartBear Alumni (Retired)

    In SoapUI, you can only run a single statement per JDBC step, so in order to add a commit step you'll have to create a new test step, as SiKing suggested.

  • OK.
    Thanks for the replies
    Is there another way (besides JDBC staps) to come to the same result? That is: "Remove data added by the previous steps in the project"

    Due to the single statement per step I already have 12 JDBC steps, to commit I also have to add another 12.
    The project's size is quadrupled because the addition of JDBC steps.
  • SmartBear_Suppo's avatar
    SmartBear Alumni (Retired)

    No, there is no way to automatically delete data created by previous test steps.

    One thing that you could check is if you have accidentally turned off auto-commit mode. It should be on by default which means that no commit step would be necessary.

    Some JDBC drivers can set the auto-commit mode in the JDBC connection string, you could check the documentation for your driver to see if that is possible.
    If not, you probably have to use separate test steps for commits.

    SmartBear Sweden
    • tomptomp's avatar
      Occasional Contributor

      Talk to me about auto-commit.  It is a setting in ReadyAPI-Soapui?  when i run an update sql statement, then, in a different test step, i run a select to verify that the update committed, it fails verification, until the testcase completes.  so it seems that the commit doesn't 'commit' until after the soapui runtime is complete.

      • BrennaLanhart's avatar
        New Contributor

        I have the same issue. I run an update statment to my database using a data connection step and then have another data connection step to commit the update. AFter that, I execute a command that generates a file based on the update to the DB, but it never reflects the update. As soon as the entire test case is finished running, then the update takes place. Is there a way around this or somehting that I am missing to make it update as soon as the statement is run?