Hello,
I have a problem and this is just my second day on ignition so maybe the problem is not a real one.
So, I have this pop up which appears a lot of times in a day on my supervision, the problem seems to be that we desabeld on ignition gateway the database STATS cause it's not working for some reason. My question is where can I find this timer ? and how can I desabled this pop up only for this problem ?
So you need to find that timer component and dig into the script for the propertyChange. The timer is going to be a component on the screen somewhere... or in a template that is being referenced.
It looks like you are trying to interact with a database 'ITM_STATS' that is faulted at the time that the script is running.
Once you find the timer and get into the script, use a python try/except logic to escape around the logic so if there is an error you can suppress it.
I Found this in the script, I dont know if the OpenAideAlarme (Name) is the cause of the problem, but I dont find any timer on the screen.
I'll look better and update the topic.
If you open the Window, the left side of the designer you should be able to expand the window, then the Root Container, and then see all the different components in the window. Luckily it is called Timer so you should be able to find it in the list of components. If it isn't in the window, then you will have to look into the different templates that are embedded in that window.
This can occur from ANY open window, so you will need to investigate all the opened windows when this error is occurring.
Can you provide a screen shot of the window from Designer?
I found this, I think it's the source of my issue. but I'm affraid to make any modification cause this ignition it's for a big client and It's running now. So I need some help please.
The thing is that we have 3 databases, Two are enabled and working perfectly, but the third one have a problem. How can I change the programme in order that he just try to connect only on the two databases and ignore the third one ? I don' see where to do it ?
if event.propertyName == "value":
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectCadencesInjection_100",event.source.parent.BDD_Statistique)
# Ajout du paramètre
#call.registerInParam('System', system.db.INTEGER, 1)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.LigneDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectTauxSaturationPlateaux_100",event.source.parent.BDD_Statistique)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.SaturationDataset = result`Preformatted text`
We know why the databases is faulted, the problem is that some disks of the RAID 5 need to be replaced. but until than the client don't what to see this pop-up every time.
Take a look at this custom property and see what the value of this is. If it is the offending database then we know you have the right section of code.
What @bschroeder suggested won't change any logic, it will just hide that popup for the times when your db is not accessible. So something like
import java.lang.Throwable # SQL errors come through as java
if event.propertyName == "value":
try:
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectCadencesInjection_100",event.source.parent.BDD_Statistique)
# Ajout du paramètre
#call.registerInParam('System', system.db.INTEGER, 1)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.LigneDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectTauxSaturationPlateaux_100",event.source.parent.BDD_Statistique)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.SaturationDataset = result`Preformatted text`
except java.lang.Throwable, e:
# Now the popup won't appear, you probably want to log this somehwere though
print e
You probably want to put the actual logic into a script module though, doing an import java.lang.Throwable on every single execution of the property change may hurt performance. Also just best practice to put logic into the scripting library as much as possible imo.
BDD_Statistique is a variable that stores the name of the database your script is supposed to use for its calls during the value change event. It's possible that this is not a static value -- meaning at any given time, it could be any of your three databases.
Bkarabinchak.psi's try / except solution is, in reality, a perfectly valid approach to quietly handling some potentially problematic code, but it's difficult for me to recommend it because, due to personal preference, I usually do everything I can to avoid having to use it:
try:
# your existing code
except:
# If your existing code threw an exception, do something else instead
# Usually, this area is used to quietly log the error information
finally: # [optional]
# Do this thing no matter what the try / except outcome was
As an alternative, here is an approach that would eliminate the exception from ever occurring in the first place:
if event.propertyName == "value":
# Get the connection info for the given database name
dbConnectionInfo = system.db.getConnectionInfo(event.source.parent.BDD_Statistique)
# If the database name returns any information, get the status value from the status column, else flag the result as invalid
dbStatus = dbConnectionInfo.getValueAt(0, 'Status') if dbConnectionInfo.rowCount else 'inValid'
# If the database connection status is valid (not faulted) continue with the code, else abort and quietly log the problem
if dbStatus == 'Valid':
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectCadencesInjection_100",event.source.parent.BDD_Statistique)
# Ajout du paramètre
#call.registerInParam('System', system.db.INTEGER, 1)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.LigneDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectTauxSaturationPlateaux_100",event.source.parent.BDD_Statistique)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.SaturationDataset = result
else:
# Area that needs further development
# Figure out what to do with this failure info if it occurs
print event.source.parent.BDD_Statistique, 'Status =', dbStatus
Hello,
I found that there is only two databases not three, so one is working and the other one is desabled on the gateway. the working one is "_Castets"
if event.propertyName == "value":
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectCadencesInjection_100",event.source.parent.BDD_Statistique)
# Ajout du paramètre
#call.registerInParam('System', system.db.INTEGER, 1)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.LigneDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectTauxSaturationPlateaux_100",event.source.parent.BDD_Statistique)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.SaturationDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectTopCinqSaturation_100",event.source.parent.BDD_Statistique)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.OperateurDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectRebuts_100",event.source.parent.BDD_Statistique)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.RebutDataset = result
And I wanna do one of the two following things :
First : If I can change the root container and DELETE a database connection and ADD it once it'sw working again.
or the seconde thing : is to change the code and Add an if condition is it is reeading the working database like this :
if event.propertyName == "value":
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectCadencesInjection_100",event.source.parent.BDD_Statistique)
if event.source.parent.BDD_Statistique == "_Castets"
# Ajout du paramètre
#call.registerInParam('System', system.db.INTEGER, 1)
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.LigneDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectTauxSaturationPlateaux_100",event.source.parent.BDD_Statistique)
if event.source.parent.BDD_Statistique == "_Castets"
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.SaturationDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectTopCinqSaturation_100",event.source.parent.BDD_Statistique)
if event.source.parent.BDD_Statistique == "_Castets"
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.OperateurDataset = result
# Appel de la procédure stockée
call = system.db.createSProcCall("Supervision_SelectRebuts_100",event.source.parent.BDD_Statistique)
if event.source.parent.BDD_Statistique == "_Castets"
# Excecution de la procédure
system.db.execSProcCall(call)
# Copie des résultats dans un dataset
result = call.getResultSet()
if result.rowCount > 0:
event.source.parent.RebutDataset = result
so here is my two questions : How can I delet the database connection STATS ?
the seconde what do you thingk about my modification of the code ? dose it seems coorect to do something like this ?
thank you