SQLalchemy QueuePool limit

143 views
Skip to first unread message

SeedSeek

unread,
Mar 2, 2017, 2:51:26 AM3/2/17
to Uliweb
http://stackoverflow.com/questions/3360951/sql-alchemy-connection-time-out

參數如何加入到 ORM ?
pool_size=20, max_overflow=100

Chunlin Zhang

unread,
Mar 2, 2017, 4:15:18 AM3/2/17
to uli...@googlegroups.com
'CONNECTION':'mysql://root:limodou@localhost/test2?charset=utf8',
这里的charset传进去一样可以吗?
还有个 CONNECTION_ARGS = {} 可以放参数试试

--
-- ----
Project : https://github.com/limodou/uliweb
doc : http://limodou.github.com/uliweb-doc
---
You received this message because you are subscribed to the Google Groups "Uliweb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uliweb+unsubscribe@googlegroups.com.
To post to this group, send email to uli...@googlegroups.com.
Visit this group at https://groups.google.com/group/uliweb.
To view this discussion on the web visit https://groups.google.com/d/msgid/uliweb/154ba65f-8527-455c-994a-ebecceeb579c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

limodou

unread,
Mar 2, 2017, 10:22:45 AM3/2/17
to uliweb


On Thu, Mar 2, 2017 at 5:15 PM, Chunlin Zhang <zhangc...@gmail.com> wrote:
> 像
>
> 'CONNECTION':'mysql://root:limodou@localhost/test2?charset=utf8',
>
> 这里的charset传进去一样可以吗?
> 还有个 CONNECTION_ARGS = {} 可以放参数试试
>
> On Thu, Mar 2, 2017 at 3:51 PM, SeedSeek <frt5...@gmail.com> wrote:
>>
>> http://stackoverflow.com/questions/3360951/sql-alchemy-connection-time-out
>>
>> 參數如何加入到 ORM ?
>>
>> pool_size=20, max_overflow=100
>>
>> --
>> -- ----
>> Project : https://github.com/limodou/uliweb
>> doc : http://limodou.github.com/uliweb-doc
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Uliweb" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to uliweb+un...@googlegroups.com.
>> To post to this group, send email to uli...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/uliweb.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/uliweb/154ba65f-8527-455c-994a-ebecceeb579c%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> -- ----
> Project : https://github.com/limodou/uliweb
> doc : http://limodou.github.com/uliweb-doc
> ---
> You received this message because you are subscribed to the Google Groups
> "Uliweb" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to uliweb+un...@googlegroups.com.
> To post to this group, send email to uli...@googlegroups.com.
> Visit this group at https://groups.google.com/group/uliweb.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/uliweb/CAG2rzAmVCZctR%3DUyv%2BfvkpF6uPWr1sFgymGu5-2U3TB5R4mP0Q%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliWeb <<simple web framework>>: https://github.com/limodou/uliweb
My Blog: http://my.oschina.net/limodou

cnidance

unread,
Mar 2, 2017, 10:49:33 AM3/2/17
to uli...@googlegroups.com
報錯,沒辦法使用
Traceback (most recent call last):
  File "apps/uliweb/manage.py", line 1668, in <module>
    main()
  File "apps/uliweb/manage.py", line 1665, in main
    call()
  File "apps/uliweb/manage.py", line 1662, in call
    execute_command_line(args or sys.argv, get_commands, 'uliweb', callback)
  File "apps/uliweb/core/commands.py", line 406, in execute_command_line
    m.execute(callback)
  File "apps/uliweb/core/commands.py", line 342, in execute
    self.do_command(args, global_options)
  File "apps/uliweb/core/commands.py", line 375, in do_command
    cmd.run_from_argv(self.prog_name, subcommand, global_options, args[1:])
  File "apps/uliweb/core/commands.py", line 185, in run_from_argv
    self.execute(args, options, global_options)
  File "apps/uliweb/core/commands.py", line 207, in execute
    self.handle(options, global_options, *args)
  File "apps/uliweb/manage.py", line 964, in handle
    self.run_simple(options, extra_files, get_app)
  File "apps/uliweb/manage.py", line 1092, in run_simple
    run_simple(options.hostname, options.port, get_app(), options.reload, False, True,
  File "apps/uliweb/manage.py", line 944, in get_app
    verbose=global_options.verbose, pythonpath=old_apps_dir)
  File "apps/uliweb/manage.py", line 143, in make_application
    **dispatcher_kwargs)
  File "apps/uliweb/core/SimpleFrame.py", line 600, in __init__
    self.init(project_dir, apps_dir)
  File "apps/uliweb/core/SimpleFrame.py", line 648, in init
    dispatch.call(self, 'after_init_apps')
  File "apps/uliweb/core/dispatch.py", line 112, in call
    _f(sender, *args, **kw)
  File "apps/uliweb/contrib/orm/__init__.py", line 40, in after_init_apps
    orm.engine_manager.add('default', d)
  File "apps/uliweb/orm/__init__.py", line 286, in add
    self.engines[name] = engine = NamedEngine(name, connection_args)
  File "apps/uliweb/orm/__init__.py", line 235, in __init__
    self._create()
  File "apps/uliweb/orm/__init__.py", line 251, in _create
    self.engine_instance = create_engine(c.get('connection_string'), **args)
  File "apps/library/sqlalchemy/engine/__init__.py", line 386, in create_engine
    return strategy.create(*args, **kwargs)
  File "apps/library/sqlalchemy/engine/strategies.py", line 144, in create
    engineclass.__name__))
TypeError: Invalid argument(s) 'max_overflow','pool_size' sent to create_engine(), using configuration SQLiteDialect_pysqlite/NullPool/TLEngine.  Please check that the keyword arguments are appropriate for this combination of components.





~Ten ~

Chunlin Zhang

unread,
Mar 2, 2017, 6:45:19 PM3/2/17
to uli...@googlegroups.com
"TypeError: Invalid argument(s) 'max_overflow','pool_size' sent to create_engine(), using configuration SQLiteDialect_pysqlite/NullPool/TLEngine"
这两个参数是 mysql 的, sqlite 没有吧?

limodou

unread,
Mar 10, 2017, 10:34:16 PM3/10/17
to uliweb
可以考虑把 self.engine_instance = create_engine(c.get('connection_string'),
**args) 的 c打印出来看看

On Thu, Mar 2, 2017 at 11:49 PM, cnidance <frt5...@gmail.com> wrote:
>>> email to uliweb+un...@googlegroups.com.
>>> To post to this group, send email to uli...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/uliweb.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/uliweb/154ba65f-8527-455c-994a-ebecceeb579c%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> -- ----
>> Project : https://github.com/limodou/uliweb
>> doc : http://limodou.github.com/uliweb-doc
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Uliweb" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to uliweb+un...@googlegroups.com.
>> To post to this group, send email to uli...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/uliweb.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/uliweb/CAG2rzAmVCZctR%3DUyv%2BfvkpF6uPWr1sFgymGu5-2U3TB5R4mP0Q%40mail.gmail.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> -- ----
> Project : https://github.com/limodou/uliweb
> doc : http://limodou.github.com/uliweb-doc
> ---
> You received this message because you are subscribed to the Google Groups
> "Uliweb" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to uliweb+un...@googlegroups.com.
> To post to this group, send email to uli...@googlegroups.com.
> Visit this group at https://groups.google.com/group/uliweb.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/uliweb/CAHLXMV9-rHpfaSH0zxUS3yagvBN%3DqpAMHqCfNk9gndBmx7j5Rg%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages