Seems the problem is on cx_Oracle,
I asked on cx_oracle mailing list and they suggested me, this:
... write your own equivalent of makedsn, which really ought not be too hard.
You'd want to emit something like this:
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=your-db-hostname)(PORT=yourport)))(CONNECT_DATA=(SERVICE_NAME=your-service-name)))
vs. what makedsn emits, which is stuff like this:
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=your-db-hostname)(PORT=yourport)))(CONNECT_DATA=(SID=your-dbname)))
I tried to replace 'SID' with 'SERVICE_NAME' in this string returned by
makedsn like this:
dsn =
cx_Oracle.makedsn(parms['host'],parms['port'],parms['dbname']).replace('SID','SERVICE_NAME')
and IT WORKS, but I don't know how to apply this to tg+sqlalchemy in the
following context:
from turbogears import database
from sqlalchemy.orm import class_mapper
database.bind_meta_data()
engine = database.get_engine()
session = database.session
def mapper(klass, *args, **kw):
session.mapper(klass, *args, **kw)
class_mapper(klass).compile()
j
Carlos Daniel Ruvalcaba Valenzuela wrote:
At simple view it could be the connection string where it should be:
provider://user:pwd@host:port/db
Where provider is the name of the database connector/driver, such as
postgresql, oracle, mysql, etc.
Check the SQAlchemy docs on this:
http://www.sqlalchemy.org/docs/core/engines.html
Regards,
Carlos Ruvalcaba
--
Jose Soares
Sferacarta Net
Via Bazzanese 69
40033 Casalecchio di Reno
Bologna - Italy
Ph +39051591054
fax +390516131537
web:www.sferacarta.com
Le informazioni contenute nella presente mail ed in ogni eventuale file
allegato sono riservate e, comunque, destinate esclusivamente alla persona o
ente sopraindicati, ai sensi del decreto legislativo 30 giugno 2003, n. 196. La
diffusione, distribuzione e/o copiatura della mail trasmessa, da parte di
qualsiasi soggetto diverso dal destinatario, sono vietate. La correttezza,
l’integrità e la sicurezza della presente mail non possono essere garantite. Se
avete ricevuto questa mail per errore, Vi preghiamo di contattarci
immediatamente e di eliminarla. Grazie.
This communication is intended only for use by the addressee, pursuant to
legislative decree 30 June 2003, n. 196. It may contain confidential or
privileged information. You should not copy or use it to disclose its contents
to any other person. Transmission cannot be guaranteed to be error-free,
complete and secure. If you are not the intended recipient and receive this
communication unintentionally, please inform us immediately and then delete
this message from your system. Thank you.
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.