ORM DB connections

55 views
Skip to first unread message

David Sedeño

unread,
Jun 4, 2015, 11:48:33 AM6/4/15
to lu...@googlegroups.com
Hi,

We are in process to add more ORM models with other databases with the datasource="another_db" option in the models.

The problem we have seen is that when you simple do a EntityLoad of *any* model, lucee open N connections to the DB, with N=number of distinct datasource you have in your models.

So, if you have:

model1.cfc -> datasource1 (main datasource, without datasource option in the model)
model2.cfc -> datasource2
model3.cfc -> datasource3
model4.cfc -> datasource4

And you do:

  EntityLoadByPk('model1', 1);

Lucee (in my case Tomcat), always open 4 database connections and not reuse existing ones. So if you reload the page, you have 8 DB connections and so on.

We are trying to add our historical dbs (13 models) and this issue blocks us of doing it.

Is there any configuration option for this ?

Using Lucee 4.5.1

Thanks
--
David Sedeño

Julian Halliwell

unread,
Jun 4, 2015, 3:48:13 PM6/4/15
to lu...@googlegroups.com
Hi David

I can confirm this behaviour from a test with one additional ORM
datasource, although on each page reload an extra connection only
seems to be opened for the second datasource, not both.

Not good though. I would raise a ticket.

Meantime if your various datasources are all on the same database
server and permissions allow, then you could try using the "catalog"
attribute in your cfcomponent tag/script to reference the name of the
relevant database, e.g.

[application.cfc]
this.datasource="datasource1";

[model2.cfc]
component persistent="true" catalog="database2"{}

Julian.

David Sedeño

unread,
Jun 5, 2015, 4:43:25 AM6/5/15
to lu...@googlegroups.com
Hi Julian,

Sadly we have our historic data in another database server so I can't use the catalog attribute.

In jira I see some ORM related bugs that also affects us. Is there any plan to take an eye to this bugs ?

https://luceeserver.atlassian.net/browse/LDEV-78
https://luceeserver.atlassian.net/browse/LDEV-96

I think my company could put some money in order to try to solve this bugs more quickly. I need to contact Rasia for this ?

Thanks
---
David Sedeño

Michael Offner

unread,
Jun 25, 2015, 4:58:44 AM6/25/15
to lucee

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/a11ff001-5188-4c19-aa67-90fd7cd89394%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Julian Halliwell

unread,
Jun 25, 2015, 5:21:23 AM6/25/15
to lu...@googlegroups.com
Great to see the "in development" status, Micha. Looking forward to
the various ORM connection-related problems introduced around the time
of the fork being fixed at last.
Reply all
Reply to author
Forward
0 new messages