I am using sqlite and I tried sessions in db (again) and I cannot reproduce 
this problem.

On Monday, 15 October 2012 16:03:45 UTC-5, Bill Thayer wrote:
>
> Thought I'd start over with a brand new application & get the wiki working 
> but I am running into difficulty before I even get to the wiki part.
> I created a brand new app and started by moving my 0.py file into models 
> then edited db.py like so:
>
>
> if not request.env.web2py_runtime_gae:
>     ## if NOT running on Google App Engine use SQLite or other DB
>     db = DAL(settings.database_uri, check_reserved=['oracle'])    
>     ## store sessions and tickets there
>     session.connect(request, response, db=db, migrate=
> 'db.web2py_session_tamoto')
> else:
> .
> .
> .
>
>
> ## create all tables needed by auth if not custom tables
> auth.define_tables(username=True, signature=False, migrate=False)
>
>
>
> Of course I get an Oracle Error:
>
> Traceback (most recent call last):
>  File "C:\web2py_src_2.1.1\web2py\gluon\restricted.py", line 209, inrestricted
>  exec ccode in environment
>  File 
> "C:/web2py_src_2.1.1/web2py/applications/TAMOTO/models/db.py"<http://127.0.0.1:8000/admin/default/edit/TAMOTO/models/db.py>
> , line 16, in <module>
>  session.connect(request, response, db=db, migrate=
> 'db.web2py_session_tamoto')
>  File "C:\web2py_src_2.1.1\web2py\gluon\globals.py", line 581, in connect
>  migrate=table_migrate,
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7092, indefine_table
>  table = self.lazy_define_table(tablename,*fields,**args)
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7124, 
> inlazy_define_table
>  polymodel=polymodel)
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 920, in create_table
>  self.create_sequence_and_triggers(query,table)
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 2865, 
> increate_sequence_and_triggers
>  self.execute(query)
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 2856, in execute
>  return self.log_execute(command, args)
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1687, in log_execute
>  ret = self.cursor.execute(*a, **b)
> DatabaseError: ORA-00955: name is already used by an existing object
>
>
> Thought I might give writing a patch a try so I tried catching and ignoring 
> the exception in the OracleAdaptor but it does not work.
>
> After setting migrate_enabled to False:
>     db = DAL(settings.database_uri, check_reserved=['oracle'], 
> migrate_enabled=False) 
>
>    
> I get this error:
> Traceback (most recent call last):
>  File "C:\web2py_src_2.1.1\web2py\gluon\main.py", line 541, in wsgibase
>  session._try_store_in_db(request, response)
>  File "C:\web2py_src_2.1.1\web2py\gluon\globals.py", line 670, in 
> _try_store_in_db
>  record_id = table.insert(**dd)
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 7812, in insert
>  return ret
>  File "C:\web2py_src_2.1.1\web2py\gluon\dal.py", line 1160, in insert
>  raise e
> IntegrityError: ORA-01400: cannot insert NULL into 
> ("UWAVEDAT"."WEB2PY_SESSION_TAMOTO"."ID")
>
>
>
>

-- 



Reply via email to