Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_connection_name other than default #13

Open
hvoers opened this issue Aug 16, 2016 · 3 comments
Open

db_connection_name other than default #13

hvoers opened this issue Aug 16, 2016 · 3 comments

Comments

@hvoers
Copy link
Contributor

hvoers commented Aug 16, 2016

In my config.yml I have:
plugins: DBIC: interch: schema_class: Interchange6::Schema dsn: "..." ... etc ...
So I want to point the session engine to that schema name:

`engines:
session:
DBIC:
db_connection_name: interch # connection name from DBIC plugin

session: DBIC
`
I get this error:

[apptestname:49759] error @2016-08-16 22:16:52> Route exception: Exception caught in 'core.app.before_request' filter: Hook error: The schema default is not configured at /usr/local/lib/perl5/site_perl/DBICx/Sugar.pm line 52.
at /usr/local/lib/perl5/site_perl/Dancer2/Plugin.pm line 580.
at /usr/local/lib/perl5/site_perl/Dancer2/Core/Role/Hookable.pm line 115. in /usr/local/lib/perl5/site_perl/Dancer2/Core/App.pm l. 1388

I think this happens at the moment of session creation.

What do you think?

@hvoers
Copy link
Contributor Author

hvoers commented Aug 17, 2016

Extra info: I also use a BEGIN block in the main app with:

DBICx::Sugar::config( config->{plugins}->{DBIC} );

to do some initial stuff.

When I remove that line I get the error:

[apptestname:62848] error @2016-08-17 02:12:50> Route exception: Exception caught in 'core.app.before_request' filter: Hook error: Unable to create a new session: could not find a config.yml or config.yaml file at /usr/local/lib/perl5/site_perl/Dancer2/Session/DBIC.pm line 384.
at /usr/local/lib/perl5/site_perl/Dancer2/Core/App.pm line 434.
at /usr/local/lib/perl5/site_perl/Dancer2/Plugin.pm line 580.
at /usr/local/lib/perl5/site_perl/Dancer2/Core/Role/Hookable.pm line 115. in /usr/local/lib/perl5/site_perl/Dancer2/Core/App.pm l. 1388

It must be session creation calling "schema()" with no config.

@hvoers
Copy link
Contributor Author

hvoers commented Aug 20, 2016

I have made a PR ironcamel/DBICx-Sugar#3
to get some extra tools to debug this.

@racke
Copy link
Member

racke commented Aug 20, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants