Process crash with no reason
gil.shinar at gmail.com
gil.shinar at gmail.com
Wed Jan 28 12:12:57 EST 2009
On Jan 27, 5:59 pm, Philip Semanchuk <phi... at semanchuk.com> wrote:
> On Jan 27, 2009, at 10:34 AM, gil.shi... at gmail.com wrote:
>
>
>
> > On Jan 27, 2:10 pm, Tim Golden <m... at timgolden.me.uk> wrote:
> >> gil.shi... at gmail.com wrote:
> >>> On Jan 26, 8:40 pm, Philip Semanchuk <phi... at semanchuk.com> wrote:
> >>>> On Jan 26, 2009, at 1:13 PM, gil.shi... at gmail.com wrote:
>
> >>>>> Hi All,
> >>>>> I'm running a program that is acting as a nice interface to
> >>>>> sybase'
> >>>>> replication server. The program is using the cherrypy web
> >>>>> service for
> >>>>> the GUI. The process is crashing every few days with no reason.
> >>>>> In the
> >>>>> log I can see INFO and DEBUG (No ERROR) log lines and I do not
> >>>>> get any
> >>>>> TraceBack python's message. This program is running on solaris 9
> >>>>> machine.
> >>>>> Where can I see or what can I do in order to find out what
> >>>>> causes the
> >>>>> process to crash?
> >>>>> I have tried simulating a "traceBack" message and I could see this
> >>>>> traceback message in one of the log files I'm using. When the
> >>>>> process
> >>>>> crashes without my help, I don't have a clue.
> >>>>> Let me know if you need any other info
> >>>> Although Python isn't immune to fatal errors like you describe, I'd
> >>>> immediately suspect a 3rd-party module instead, esp. one written
> >>>> in C
> >>>> or C++. Are you using anything like that?
>
> >>> No I do not.
>
> >> Then how are you interacting with Sybase?
>
> > I'm using python's functions to run sybase sql commands.
>
> Can you give a short code sample? I'm unaware of how one would use the
> standard Python library to talk to Sybase, unless Sybase has a raw
> socket interface or some such.
First of all I have found the following python's import:
import Sybase
To connect the sybase server we are using the following function:
def _getConnection (self):
db = Sybase.connect(self.dbs, self.login[0], self.login
[1], datetime='auto')
return db
To execute a DBS query, we are using the following function:
def _executeQuery(self, cursor, query, expected_result=None):
try:
self.logger.debug('Executing query:' + query +
', expected:' + str(expected_result))
cursor.execute(query)
except Sybase.DatabaseError, e:
if ((expected_result != None) and ("Msg " +
expected_result in str(e))):
return (DBStatus.SUCCESS,
self._getDBMsg(str(e)))
raise Sybase.DatabaseError, self._getDBMsg(str
(e))
return (DBStatus.SUCCESS, "")
Do you need anything else?
Thanks a lot
More information about the Python-list
mailing list