Setting a local variable in MySQL no longer works

545 Views Asked by At

I use a user variable in MySQL to control the operation of triggers in my database. These variables are set in a service with the following Java code:

    MedicalDB service = (MedicalDB)RuntimeAccess.getInstance().getServiceBean("medicalDB"); // medicaldb is the name of the connection to DB
    try {
        service.begin();
        Session session = service.getDataServiceManager().getSession();

        sql = "SET @disableTriggers = 0;";
        session.createQuery(sql).executeUpdate(); <---- Throws null pointer exception

This code has worked properly for a long time but now when the service executes the executeUpdate() method it throws a null pointer exception. The issue is with the SET statement since, if I comment it out, subsequent sql statements function properly.

Has something changed with the JRE (build 1.7.0-03-b05) or Hibernate. I am using Wavemaker 6.4.6GA

0

There are 0 best solutions below