forum.vmspython.org Forum Index forum.vmspython.org
Forum system
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ProgrammingError from attachDB

 
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS
View previous topic :: View next topic  
Author Message
ojr



Joined: 01 Dec 2010
Posts: 18

PostPosted: Fri Jun 14, 2013 6:15 pm    Post subject: ProgrammingError from attachDB Reply with quote

I have 2 python applications on a WASD web server and both of these application point to their respective database. Let's call them db1 and db2. One application points to one database. I came across the following error when attempting to login into one application which uses database db1.

Code:
121      if dbs.has_key(alias):
122        if dbs[alias] != filename:
123          raise ProgrammingError
124        return
125      if alias == '':
<class 'rdb.rdb_exceptions.ProgrammingError'>:
args =()
message=''


While the second application which points to db2 is working fine, a user can login. I also receive this error on the second application if a user is logged in the first application. It seems as though I can only access one application at a time. First of all, what does this error mean? I do not assign an alias. Do you have any suggestions on how to begin troubleshooting this issue?
Thank you for your input.
Back to top
View user's profile Send private message
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Sat Jun 15, 2013 3:13 pm    Post subject: Reply with quote

Hi.

What is "database" here? Rdb?
And if so, what does "point to" means?

Can you make two short reproducers (incl complete Python
code with the imports and so on) that shows the error?
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Mon Jun 17, 2013 10:04 am    Post subject: Reply with quote

Hi,

The problem is that you try to use the same (empty) alias for 2 different databases.

For performance reason, CGIPlus process keep attachment between each request.

You need to use separate process for each application, this can be done by updated your WASD mapping rules.

or

Use an alias to access each database.

Probably better to use first solution.


JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jescab



Joined: 28 Jan 2008
Posts: 254

PostPosted: Tue Jun 18, 2013 5:10 pm    Post subject: Reply with quote

I have a related problem...
I have one single mapping for the PyRTE :
Code:
exec /hv-bin/*.py (cgi_exe:pyrte)/disk1/web/bin/*.py \
     script=syntax=unix script=query=none map=once ods=5

Problem is that whenever I replace on of the PY files used, the server crasches
with a message in the browser and the page has to be reloaded.
That is, no matter which PY file got replaced.

What do I have to add the the exec rule above to have separate server process per application?
Is this enough? :
Code:

exec /hv-bin/app1.py (cgi_exe:pyrte)/disk1/web/bin/app2.py \
     script=syntax=unix script=query=none map=once ods=5
exec /hv-bin/app2.py (cgi_exe:pyrte)/disk1/web/bin/app2.py \
     script=syntax=unix script=query=none map=once ods=5
exec /hv-bin/app3.py (cgi_exe:pyrte)/disk1/web/bin/app3.py \
     script=syntax=unix script=query=none map=once ods=5
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Tue Jun 18, 2013 6:47 pm    Post subject: Reply with quote

This is probably a question for the WASD mailing list, but it this work I think this is enough.

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ojr



Joined: 01 Dec 2010
Posts: 18

PostPosted: Tue Jun 18, 2013 9:50 pm    Post subject: Reply with quote

Thank you for your input.

Here is what I have in the mapping rules for both applications.
exec /prod/*.py* (cgi_exe:pyrte)/webapp/cgi-bin/prodapp/*.py* \
script=as=dbuser script=syntax=unix script=query=none map=once ods=5

exec /dev/*.py* (cgi_exe:pyrte)/webapp/cgi-bin/dev/*.py* \
script=as=dbsuser script=syntax=unix script=query=none map=once ods=5

Am I missing anything in the rules? Is there a problem with using the same dbuser user in the rules?

Would I have issues if I modified both the mapping rules and created a different alias for each database?
Back to top
View user's profile Send private message
jfp



Joined: 12 Jul 2004
Posts: 636

PostPosted: Wed Jun 19, 2013 8:11 am    Post subject: Reply with quote

ojr wrote:
Am I missing anything in the rules? Is there a problem with using the same dbuser user in the rules?


Seem ok, but you can use the WASD mailing list to be sure.

I prefer to use CGIPlus instead RTE but I 'm not sure if there are many differences.

ojr wrote:
Would I have issues if I modified both the mapping rules and created a different alias for each database?


Yes you can, having different alias allow you to use the 2 database in the same program/process

JF
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vmspython.org Forum Index -> Python for OpenVMS All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group