ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SQL Insert via JAVA

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

  • SQL Insert via JAVA

    We changed a field from 6,0 to 15A, same field name.

    The insert from JAVA still thinks the data field is 6,0. Seems as though the run plan or something is cached.

    If you make a change like that, do you have to do something to kill the existing run plan to get this to work?

    Thanks!

    -R

  • #2
    Re: SQL Insert via JAVA

    How are you running the Java? If you have changed the code then the JVM instance that is running that code will need restarting to pick up the changes. On start up the JVM loads in all the classes it needs. There is no un-loader. This is akin to having to reclaim your activation groups to pick up ILE program changes.

    We have some pre started jobs that pick entries of a data queue and do some Java processing. If we have to re-compile the Java then it is not enough to reclaim the activation groups. We have to end the jobs that have JVM instances started and then start off some new ones. I seem to remember that there is a way to end a JVM instance but you can't then start a new one for the same job.

    May or may not help?
    Ben

    Comment


    • #3
      Re: SQL Insert via JAVA

      Hey Ben

      Rick was asking this question for a problem we are having. We run Websphere 5.1 on Linux and deployed out to different servers based on the app that is changing. When we deploy the script we run stops the server, deploys the code, and restarts the server which in essence would kill the JVM and then restart it. We think what is happening is a prepared statement was cached and the Java app keeps pulling the cached statement when it tries to insert and sees the previous data type. I have to believe others have had the same issue.
      Golf is a game in which you yell "fore," shoot six, and write down five.

      Comment


      • #4
        Re: SQL Insert via JAVA

        and it doesn't throw this error in the development environment? I'm sorry I've not come across this.
        Ben

        Comment


        • #5
          Re: SQL Insert via JAVA

          no localhost and dev deploys both work fine and never had an issue
          Golf is a game in which you yell "fore," shoot six, and write down five.

          Comment


          • #6
            Re: SQL Insert via JAVA

            Is this for DB2 in the System i? If so, an IPL should rid the cache of any lingering prior run data.
            "Time passes, but sometimes it beats the <crap> out of you as it goes."

            Comment


            • #7
              Re: SQL Insert via JAVA

              I think you are right, unfortunately we do not IPL until Sunday and this happened last Wednesday. My question is what in the IPL would cause the cached insert statement to re-create? Isn't there some way to do this w/o an IPL?
              Golf is a game in which you yell "fore," shoot six, and write down five.

              Comment

              Working...
              X