Re: [Catalyst] Catalyst and oracle database.
Have you tried to troubleshoot the connection at the "other" side, i.e. the Oracle server? What does the listener log say about the failed connection, and about the successful ones from the same machine (your Catalyst host)? How do they differ? j. Jorge González Villalonga Director Técnico DAIKON Integración y Desarrollo S.L. Telf: (+34) 91 188 08 28 Fax: (+34) 91 632 65 42 www.daikon.es El 11/03/11 06:28, Rohan M escribió: Dear all, Thanks for the reply. I'm trying to connect the Catalyst application hosted on 192.168.100.10 to the Oracle server on 192.168.100.107. I tested the oracle connection from 192.168.100.10 with sql plus and perl-DBI combination. Anything that I'm missing? Regards, Rohan M On Thu, Mar 10, 2011 at 6:00 PM, Jorge Gonzalez jorge.gonza...@daikon.es wrote: I think you are doing it right from the Catalyst side, I connect to Oracle routinely in exactly the same form as you show, with no issues. If you omit the "create=static", it's probably creating a dynamic schema, and so it's created OK but you run into problems at runtime, since the creation of schema classes is being deferred until then, as well as the connection to the database. Maybe you have tried connecting to the database with other methods (sqlplus, DBI) from the same host, and so it works, but for the Catalyst app you are doing it remotely? If so, your tests are not conclusive. My bet would be that although you have correctly configured the Oracle database locally, the listener is not, and does not accept connections from the network for that SID. But of course, I might be wrong. :-) Cheers Jorge Jorge González Villalonga Director Técnico DAIKON Integración y Desarrollo S.L. Telf: (+34) 91 188 08 28 Fax: (+34) 91 632 65 42 www.daikon.es El 10/03/11 13:16, Rohan M escribió: On Thu, Mar 10, 2011 at 4:32 PM, Octavian Rasnita orasn...@gmail.com wrote: From: Rohan M Dear All, I'm trying to use Oracle database as a back-end database for Catalyst application. (I tried MySQL and its working properly for me ). At first, I tried the following command - perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static 'dbi:Oracle:sid=TEST1;host=192.168.100.107; port=1521' 'user' 'pass' Have you tried with sid=test.abcd.com? Yes. I tried this also. perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static dbi:Oracle:sid=test.abcd.com;host=192.168.100.107;port=1521 user pass Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ The complete error is "DBI Connection failed: DBI connect('sid=test.abcd.com;host=192.168.100.107;port=1521','user',...) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at /usr/local/share/perl/5.10.1/DBIx/Class/Storage/DBI.pm line 1262 " -- Rohan M ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ -- रोहन मल्लेल्रवार ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst and oracle database.
Dear All, I believe the oracle server version is 8.1.7 and I don't have access to that server. I guess the reason was, I was putting SID=test.abcd.com which was wrong. I think Catalyst model provides SID INSTANCE_NAME SERVER SERVICE_NAME as options that can be mentioned as parameters. These are all name=value pairs that *Can* (?) be put for model creation. Today , I tried with perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static 'dbi:Oracle:*SERVICE_NAME=test.abcd.com*;host=192.168.100.107; port=1521' 'user' 'pass' And I think this connects (?) but since the database has many many tables so the script kind of stays still. Can we just create one table dynamically in order to test everything works fine? I mean, provide single table name to the above command and test. Thanks for the help.. Regards, ROhan On Fri, Mar 11, 2011 at 1:29 PM, Jorge Gonzalez jorge.gonza...@daikon.eswrote: Have you tried to troubleshoot the connection at the other side, i.e. the Oracle server? What does the listener log say about the failed connection, and about the successful ones from the same machine (your Catalyst host)? How do they differ? j. *Jorge González Villalonga* Director Técnico *DAIKON Integración y Desarrollo S.L.* Telf: (+34) 91 188 08 28 Fax: (+34) 91 632 65 42 *www.daikon.es* El 11/03/11 06:28, Rohan M escribió: Dear all, Thanks for the reply. I'm trying to connect the Catalyst application hosted on 192.168.100.10 to the Oracle server on 192.168.100.107. I tested the oracle connection from 192.168.100.10 with sql plus and perl-DBI combination. Anything that I'm missing? Regards, Rohan M On Thu, Mar 10, 2011 at 6:00 PM, Jorge Gonzalez jorge.gonza...@daikon.eswrote: I think you are doing it right from the Catalyst side, I connect to Oracle routinely in exactly the same form as you show, with no issues. If you omit the create=static, it's probably creating a dynamic schema, and so it's created OK but you run into problems at runtime, since the creation of schema classes is being deferred until then, as well as the connection to the database. Maybe you have tried connecting to the database with other methods (sqlplus, DBI) from the same host, and so it works, but for the Catalyst app you are doing it remotely? If so, your tests are not conclusive. My bet would be that although you have correctly configured the Oracle database locally, the listener is not, and does not accept connections from the network for that SID. But of course, I might be wrong. :-) Cheers Jorge *Jorge González Villalonga* Director Técnico *DAIKON Integración y Desarrollo S.L.* Telf: (+34) 91 188 08 28 %28%2B34%29%2091%20188%2008%2028 Fax: (+34) 91 632 65 42 %28%2B34%29%2091%20632%2065%2042 *www.daikon.es* El 10/03/11 13:16, Rohan M escribió: On Thu, Mar 10, 2011 at 4:32 PM, Octavian Rasnita orasn...@gmail.comwrote: *From:* Rohan M rohan7...@gmail.com Dear All, I'm trying to use Oracle database as a back-end database for Catalyst application. (I tried MySQL and its working properly for me ). At first, I tried the following command - perl script/testapp_create.pl model DB DBIC::Schema DB::Schema * create=static* 'dbi:Oracle:sid=TEST1;host=192.168.100.107; port=1521' 'user' 'pass' Have you tried with sid=test.abcd.com? Yes. I tried this also. perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static dbi:Oracle:sid=test.abcd.com;host=192.168.100.107;port=1521 user pass Octavian ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ The complete error is DBI Connection failed: DBI connect('sid=test.abcd.com;host=192.168.100.107;port=1521','user',...) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at /usr/local/share/perl/5.10.1/DBIx/Class/Storage/DBI.pm line 1262 -- Rohan M ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ -- रोहन मल्लेल्रवार ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site:
Re: [Catalyst] Catalyst and oracle database.
Sure. From here: http://search.cpan.org/~rkitover/DBIx-Class-Schema-Loader-0.07000/lib/DBIx/Class/Schema/Loader/Base.pm#constraint constraint Only load tables matching regex. Best specified as a qr// regex DBIx::Class::SAchema::Loader is the class Catalyst uses to create the schema, and you can send parameters to it from the Catalyst helper script. So your helper script invocation would something similar to this: perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static 'constraint=qr/^YOUR_TABLE$/' 'dbi:Oracle:SERVICE_NAME=test.abcd.com;host=192.168.100.107; port=1521' 'user' 'pass' (quotes around the "constraint" parameter to prevent shell escaping and such). There are a few other parameters whic I've found pretty useful, like "qualify_objects" (prepending the schema name to all table names in the class files). I recomend to check them all just in case you are interested. Regards J. Jorge González Villalonga Director Técnico DAIKON Integración y Desarrollo S.L. Telf: (+34) 91 188 08 28 Fax: (+34) 91 632 65 42 www.daikon.es El 11/03/11 11:34, Rohan M escribió: Dear All, I believe the oracle server version is 8.1.7 and I don't have access to that server. I guess the reason was, I was putting SID=test.abcd.com which was wrong. I think Catalyst model provides "SID INSTANCE_NAME SERVER SERVICE_NAME " as options that can be mentioned as parameters. These are all name=value pairs that Can (?) be put for model creation. Today , I tried with perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static 'dbi:Oracle:SERVICE_NAME=test.abcd.com;host=192.168.100.107; port=1521' 'user' 'pass' And I think this connects (?) but since the database has many many tables so the script kind of stays still. Can we just create one table dynamically in order to test everything works fine? I mean, provide single table name to the above command and test. Thanks for the help.. Regards, ROhan On Fri, Mar 11, 2011 at 1:29 PM, Jorge Gonzalez jorge.gonza...@daikon.es wrote: Have you tried to troubleshoot the connection at the "other" side, i.e. the Oracle server? What does the listener log say about the failed connection, and about the successful ones from the same machine (your Catalyst host)? How do they differ? j. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst and oracle database.
Dear Jorge, Thanks a lot for you help. I really appreciate it. The command and the information you have mentioned below is very useful. I'll try it definitely. Meanwhile, I tried creating a class manually for a table and model using the command ( omitting create=static) and this has *worked* for me. Now I could connect to Oracle database. It appears that the reason was the In-proper SID or SID=servicename values. Thanks Jorge ! Rohan. On Fri, Mar 11, 2011 at 4:57 PM, Jorge Gonzalez jorge.gonza...@daikon.eswrote: Sure. From here: http://search.cpan.org/~rkitover/DBIx-Class-Schema-Loader-0.07000/lib/DBIx/Class/Schema/Loader/Base.pm#constraint constrainthttp://search.cpan.org/%7Erkitover/DBIx-Class-Schema-Loader-0.07000/lib/DBIx/Class/Schema/Loader/Base.pm#___top Only load tables matching regex. Best specified as a qr// regex DBIx::Class::SAchema::Loader is the class Catalyst uses to create the schema, and you can send parameters to it from the Catalyst helper script. So your helper script invocation would something similar to this: perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static 'constraint=qr/^YOUR_TABLE$/' 'dbi:Oracle:* SERVICE_NAME=test.abcd.com*;host=192.168.100.107; port=1521' 'user' 'pass' (quotes around the constraint parameter to prevent shell escaping and such). There are a few other parameters whic I've found pretty useful, like qualify_objects (prepending the schema name to all table names in the class files). I recomend to check them all just in case you are interested. Regards J. *Jorge González Villalonga* Director Técnico *DAIKON Integración y Desarrollo S.L.* Telf: (+34) 91 188 08 28 Fax: (+34) 91 632 65 42 *www.daikon.es* El 11/03/11 11:34, Rohan M escribió: Dear All, I believe the oracle server version is 8.1.7 and I don't have access to that server. I guess the reason was, I was putting SID=test.abcd.com which was wrong. I think Catalyst model provides SID INSTANCE_NAME SERVER SERVICE_NAME as options that can be mentioned as parameters. These are all name=value pairs that *Can* (?) be put for model creation. Today , I tried with perl script/testapp_create.pl model DB DBIC::Schema DB::Schema create=static 'dbi:Oracle:*SERVICE_NAME=test.abcd.com*;host=192.168.100.107; port=1521' 'user' 'pass' And I think this connects (?) but since the database has many many tables so the script kind of stays still. Can we just create one table dynamically in order to test everything works fine? I mean, provide single table name to the above command and test. Thanks for the help.. Regards, ROhan On Fri, Mar 11, 2011 at 1:29 PM, Jorge Gonzalez jorge.gonza...@daikon.eswrote: Have you tried to troubleshoot the connection at the other side, i.e. the Oracle server? What does the listener log say about the failed connection, and about the successful ones from the same machine (your Catalyst host)? How do they differ? j. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ -- रोहन मल्लेल्रवार image/png___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Catalyst and oracle database.
Glad to help. J. Jorge González Villalonga Director Técnico DAIKON Integración y Desarrollo S.L. Telf: (+34) 91 188 08 28 Fax: (+34) 91 632 65 42 www.daikon.es El 11/03/11 13:18, Rohan M escribió: Dear Jorge, Thanks a lot for you help. I really appreciate it. The command and the information you have mentioned below is very useful. I'll try it definitely. Meanwhile, I tried creating a class manually for a table and model using the command ( omitting create=static) and this has worked for me. Now I could connect to Oracle database. It appears that the reason was the In-proper SID or SID=servicename values. Thanks Jorge ! Rohan. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Authentication with REST and Catalyst
Hi Everyone, What is the best practice for implementation authentication and authorization when building a REST API application using catalyst? How should authentication be implementation? Any guide or example would be very helpful. Thanks ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Authentication with REST and Catalyst
On Fri, Mar 11, 2011 at 12:48 PM, linuxsupport lin.supp...@gmail.comwrote: Hi Everyone, What is the best practice for implementation authentication and authorization when building a REST API application using catalyst? How should authentication be implementation? Any guide or example would be very helpful. Thanks ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/ Probably an API key system. It's much easier to maintain a single key instead of having to pass a username/password each time you make a request or what not. -- Devin Austin http://www.codedright.net 9702906669 - Cell ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Authentication with REST and Catalyst
On Fri, Mar 11, 2011 at 3:00 PM, Devin Austin devin.aus...@gmail.comwrote: On Fri, Mar 11, 2011 at 12:48 PM, linuxsupport lin.supp...@gmail.comwrote: Hi Everyone, What is the best practice for implementation authentication and authorization when building a REST API application using catalyst? How should authentication be implementation? Any guide or example would be very helpful. Dev site: http://dev.catalyst.perl.org/ Probably an API key system. It's much easier to maintain a single key instead of having to pass a username/password each time you make a request or what not. i found this useful: http://www.gossamer-threads.com/lists/catalyst/users/28136 ... though i haven't implemented anything yet. ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Unicode::Encoding - utf8 \xBA does not map to Unicode
Hi, I've read some threads about unicode, utf8 and query parameters but I don't understand it enough to fix on my own, so apologies for beating a dead horse. When a URL contains a utf8 character in the query string such as ?first_name=K%E9vyn (where %E9 is é, latin small e with acute), Unicode::Encoding barfs with utf8 \xE9 does not map to Unicode. Now I believe \xE9 is Perl's internal representation of unicode, so it is already decoded by the time Unicode::Encoding::prepare_uploads is invoked. However Encode::is_utf8( $_ ) is not working or not appropriate in this instance and $enc-decode() then fails trying to decode \xE9. I have removed Unicode::Encoding from my app for the time being. It seems this is the base case for unicode in catalyst so I would think I'm doing something fundamentally wrong. All modules are up to date as of tdoay. Thanks for any help! ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/