Re: [Tutor] Exceptions while dealing with MySQL

2007-04-24 Thread Thanos Panousis
Thanks to everybody for the replies. I got some nice pointers. I know my design is nasty, but that is because I am learning...Putting object orientation in the mix, I have this question: I have an object, person, which is assosiated with some statistical data. Say for each person object, I need

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-24 Thread Alan Gauld
Thanos Panousis [EMAIL PROTECTED] wrote data. Say for each person object, I need an object variable called hairColor. This haircolor variable has to be filled through an SQL query, so the object must have some way to access a database cursor. The cool thing would be that all person objects

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-24 Thread Kent Johnson
Thanos Panousis wrote: I have an object, person, which is assosiated with some statistical data. Say for each person object, I need an object variable called hairColor. This haircolor variable has to be filled through an SQL query, so the object must have some way to access a database cursor.

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-24 Thread Thanos Panousis
I checked the SQLAlchemy and SQLObject projects, but they are not really relevant to what I am doing(moreover they are more than I can chew just yet:). I managed to get a class variable to hold a cursor via something like class person: cursor = MySQLdb.connect(stuff).cursor() BUT when I

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-24 Thread Alan Gauld
Thanos Panousis [EMAIL PROTECTED] wrote in I managed to get a class variable to hold a cursor via something like class person: cursor = MySQLdb.connect(stuff).cursor() BUT when I make a function inside my class called myConnect, where I do error checking and so on, I can't make it

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-22 Thread John Clark
Alan Gauld wrote: Thanos Panousis [EMAIL PROTECTED] wrote I am developing a network management system that relies heavily on a MySQL database. The logic of the program is unavoidably coupled with query results I get from various tables. That's pretty unusual, it normally indicates a non OO

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-22 Thread Alan Gauld
John Clark [EMAIL PROTECTED] wrote MySQL database. The logic of the program is unavoidably coupled with query results I get from various tables. That's pretty unusual, it normally indicates a non OO design. Database persistance has always been a frustration of mine in OO design -

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-22 Thread Kent Johnson
John Clark wrote: I know that there is a text book out there called Database Access Patterns, can anyone provide a recommendation or a critique of the book? Are there other (better) references I should be consulting in designing the database interaction layer of my application? I like

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-22 Thread Alan Gauld
Kent Johnson [EMAIL PROTECTED] wrote I like Martin Fowler's Patterns of Enterprise Application Architecture. I agree, except the title can be slightly misleading. Just to make it clear, the book is about application architecture for larger scale applications (not really enterprise scale

[Tutor] Exceptions while dealing with MySQL

2007-04-21 Thread Thanos Panousis
Hello list, I am developing a network management system that relies heavily on a MySQL database. The logic of the program is unavoidably coupled with query results I get from various tables. This is OK as long the mysql server has 100% uptime, but it hardly does. Say that I have to make at least

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-21 Thread Kent Johnson
Thanos Panousis wrote: Hello list, I am developing a network management system that relies heavily on a MySQL database. The logic of the program is unavoidably coupled with query results I get from various tables. This is OK as long the mysql server has 100% uptime, but it hardly does.

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-21 Thread Thanos Panousis
Well, the best thing to do is to just keep on asking until the server is up. Sending emails and other logging can be done inside whatever wrapper function. So if wrappers is a good way to go, how should I pursue this? Just making my own wrapper functions or subclassing from MySQLdb? Is it really

Re: [Tutor] Exceptions while dealing with MySQL

2007-04-21 Thread Alan Gauld
Thanos Panousis [EMAIL PROTECTED] wrote I am developing a network management system that relies heavily on a MySQL database. The logic of the program is unavoidably coupled with query results I get from various tables. That's pretty unusual, it normally indicates a non OO design. This is OK