Problem with Postgres Database Connection
Hello Everyone
I have one problem with a sofware (developed inhouse) running in client server mode. The source is written using Perl and Python. And as backend we are using Postgres database.
I have one server where Postgres database is available (say information about student)(Linux Environment) and a client(Windows environment) consisting a GUI where some programs are there which work according to the information that I pass as input and fetch the records from the server(from Postgres database) and generating PDF files as a result(say performance certificate, bonafide certificates). On client machine some compiled python files are available.
Problem is that when I execute the execuatable (GUI) from client machine it allows me to fetch data eg. Suppose I want to generate bonafide certificate of some student I have to give roll number say 2004101 as input in the text box , when I press tab key it fetches the data related to the number inputted, if data is available it displays it in non modifiable text boxes. Then to generate bonafide certificate I have to press Generate Certificate button, it generates the bonafide certificate for the student. It's a PDF file (here I am using platypus library to get the result in PDF file)
Now second case, I have another option to print Performance certificate (say grade sheet, semester wise or complete) for some student I have to apply same process as above by selecting the appropriate menu option for Performance certificate. But while I press the generate certificate button it gives programmer defined error "Can not generate certificate" and in error log file it gives me error "Connection failed in Perf_getRecords msg; Error: Current transaction is aborted, commands ignored until end of transaction block". Initially I thought is problem of TCP ip connection but as it is getting connected with the database it should only execute the query written in getRecords function. For this matter I checked the configuration files used for Postgres database (ie pg_hba.conf, postgresql.conf, pg_ident.conf)
Can you suggest some solution to me for this problem
I am giving so some part of the source code available in python file
#this function is used to get the performance records for a student
#input is the student roll number and a between clause (if certificate is year or sem wise )
#returns None on faliure and returns a sequence of PgResultSets on success
def __getRecords(rollno,betClause):
recs=None
#open the database connection
try:
con=PgSQL.connecthost=" 192.9.150.16", port=5432 ,database="dims",user="officer", password="indiaisgreat" )
except Exception,e:
writeError(" Connection failed in perf.__getRecords msg : %s" %str(e))
return None
else:
. . . . . . . . . . . . . . . . . .
Thanks in advance
|