web stats
MirthConnect: Database Write Success but no data in database - Page 2 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #11  
Old 04-23-2014, 03:45 PM
nnah nnah is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
nnah is on a distinguished road
Default

@narupley thanks for your help.

I've another question, this might be a javascript issue but can't seem to figure it out. My if else statement isn't correctly evaluated.

The data files correctly if the patients isn't already in the database, but when the patient ss# is in the database I get an error(cannot insert duplicate key in object). It suppose to return 1 and evaluate the else statement which then updates a field in the database.

I attached my channel for review. Thanks for your help.

Ike
Attached Files
File Type: xml ADTFeed.xml (10.3 KB, 4 views)
Reply With Quote
  #12  
Old 04-24-2014, 10:54 AM
nnah nnah is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
nnah is on a distinguished road
Default

this might actually be a mirth issue. I've seen the same issue in other forums (http://www.mirth.com/community/forum...ead.php?t=9601) but the recommendations aren't working. Any help will be appreciated.

I've tried changing the code a bit, it seems like I can either get once statement to be evaluated both not both. The top statement evaluates just the if while the bottom statement evaluates just the else.

old
if (result.getInt(1) == 0)

new
var cnt = result.getInt(1);
if (cnt == 1)
Reply With Quote
  #13  
Old 06-18-2015, 07:04 AM
RPHaa RPHaa is offline
Mirth Newb
 
Join Date: Sep 2010
Location: St Petersburg, Florida
Posts: 17
RPHaa is on a distinguished road
Default Channel DB writer shows SENT but no Data

I can see in my channel that the DB writer shows that the message was sent. I check the database but there is no data in the database.

The connection log for the javascript DB writer shows 'Busy' in the event column with a yellow dot.

I am searching the code for a condition that would prevent the writing of the data to the database but not finding one.
I was able to write to this database with another channel as a test exercise.

Is there something about my SQL server configuration?

Thanks in advance
Reply With Quote
  #14  
Old 06-18-2015, 10:01 AM
mbellio mbellio is offline
Mirth Newb
 
Join Date: May 2015
Posts: 6
mbellio is on a distinguished road
Default

I do believe for checking that if statement you can use
Code:
if (results.next() === false)
that will return whether or not there are values within results.

EDIT: It turns out I was actually incorrect. You can skip the entire if statement if you would like to. You can use an upsert statement in SQL rather than separate insert and update statements.

Add this statement on to your insert statement and remove the if else block around it:

Code:
...  pacct + "') ON DUPLICATE KEY UPDATE pNumber = values(pNumber)";
This will use the insert statement as normal, but if the primary key (in this case the social security number) is already in the table, the statement will instead update the values given.

Last edited by mbellio; 06-18-2015 at 11:40 AM. Reason: I was wrong and I needed to add more to this block. formatting and punctuation.
Reply With Quote
  #15  
Old 01-27-2016, 12:51 AM
yasser.saber yasser.saber is offline
What's HL7?
 
Join Date: Jun 2015
Posts: 3
yasser.saber is on a distinguished road
Default Please update if fixed or not

Hello , If this problem solved ??

I have also the same problem .. most of the messages sent and written in database with response ( Database write success, 1 rows updated) . But some messages randomly sent with response ( Database write success) but no data written in database .

And when i reprocess same message again manually by repossess option , it send success with write in database this time with response ( Database write success, 1 rows updated)
Reply With Quote
  #16  
Old 01-27-2016, 12:59 AM
yasser.saber yasser.saber is offline
What's HL7?
 
Join Date: Jun 2015
Posts: 3
yasser.saber is on a distinguished road
Default Any update

Any update
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:22 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation