Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Add new user fails, Oracle DB. Bug? Workaround.

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

  • Add new user fails, Oracle DB. Bug? Workaround.

    I just installed mirth-1.7.0.3285.zip and am using oracle for mirth DB. I created new user called mirth, ran oracle-database.sql then configured Mirth administrator to use this oracle schema.

    This is likely only a problem with oracle backends and I have a possible solution. Anyone using Oracle for the Mirth DB without a problem? I'm too new to Mirth to claim I know what I'm talking about so please let me know if this is a unique to me. If this is a problem, should it be fixed in application code or DB schema as I have done. Details below.

    I was able to change the admin user password via mirth UI but I get following error every time I try to add new user.

    Code:
    com.webreach.mirth.client.core.ClientException: method failed: HTTP/1.1 500 com.ibatis.common.jdbc.exception.NestedSQLException:   
    --- The error occurred in oracle/oracle-user.xml.  
    --- The error occurred while applying a parameter map.  
    --- Check the insertUser-InlineParameterMap.  
    --- Check the statement (update failed).  
    --- Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into ("MIRTH"."PERSON"."ID"«»)
    
    Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into ("MIRTH"."PERSON"."ID"«»)
    
    com.webreach.mirth.client.core.ServerConnection.executePostMethod(ServerConnection.java:98)
    com.webreach.mirth.client.core.Client.updateUser(Client.java:304)
    com.webreach.mirth.client.ui.Frame$3.doInBackground(Frame.java:1092)
    com.webreach.mirth.client.ui.Frame$3.doInBackground(Frame.java:1102)
    org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
    java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    java.util.concurrent.FutureTask.run(Unknown Source)
    org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)

    The error seems to indicate the ID field is not being populated. I can manually add record with mirth user.

    Code:
    [email protected]>insert into person(ID,USERNAME,PASSWORD,SALT,LOGGED_IN) VALUES(PERSON_SEQUENCE.nextval,'NEWUSER','HASHED_PW','SALT',0);
    
    1 row created.
    
    [email protected]>

    New to mirth, not sure if this is OK to do but this worked for me:

    Code:
    Create Trigger PERSON_ID_AUTONUMBER
    Before INSERT OR UPDATE on PERSON
    FOR EACH ROW
    DECLARE
       iAUTONUMBER PERSON.ID%TYPE;
       cannot_change_AUTONUMBER EXCEPTION;
    
    BEGIN
       IF INSERTING THEN
          SELECT PERSON_SEQUENCE.NEXTVAL into iAUTONUMBER FROM dual;
          :new.ID := iAUTONUMBER;
       END IF; -- End of Inserting Code
    
       IF UPDATING THEN
          -- Do not allow the PK to be changed.
          IF NOT(:new.ID = :old.ID) THEN
             RAISE cannot_change_AUTONUMBER;
          END IF;
    
       END IF; -- End of Updating Code
    
    EXCEPTION
       WHEN cannot_change_AUTONUMBER THEN
          raise_application_error(-20000,'Cannot Change AUTONUMBER Value');
    END;
    /

  • #2
    Re:Add new user fails, Oracle DB. Bug? Workaround.

    Thanks for the heads up.

    http://www.mirthproject.org/communit...owse/MIRTH-790
    Jacob Brauer
    Director, Software Development
    NextGen Healthcare

    sigpic

    Comment

    Working...
    X