Multiple orm datasources - different database types

How do I specify multiple orm dialects? I’m running two different kinds of
database servers. One is mysql and the other is microsoft sql server. How
do I get Lucee to read both database’s dialects?

anyone know how to handle multiple dialects in lucee for two database
types? MySQL and Microsoft SQL Server.

I tried something like this in my application.cfc but it does not respect
this.

  • this.datasources[“a”] = {*

  • class: ‘com.microsoft.jdbc.sqlserver.SQLServerDriver’*

  • , connectionString:
    ‘jdbc:sqlserver://0.0.0.0:1433;DATABASENAME=data;sendStringParametersAsUnicode=true;SelectMethod=direct;useUnicode=true;characterEncoding=UTF-8’*

  • , connectionLimit:25 // default:-1*

  • , connectionTimeout:1 // default: 1; unit: seconds*

  •                    , dialect: "MicrosoftSQLServer"*
    
  • };*

  •    this.datasources["b"] = {*
    
  •              class: 'org.gjt.mm.mysql.Driver'*
    
  •            , connectionString:
    

‘jdbc:mysql://0.0.0.0:3306/data?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true
http://0.0.0.0:3306/data?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true’*

  •            , dialect: "MySQLwithInnoDB"*
    
  •    };*
    

It only understands this.ormSettings.dialect = “MicrosoftSQLServer” which
creates a problem when having two database types.

I ask this question b/c I’m trying to fix another issue in a previous email
i sent a few minutes ago with database driver returning random errors. So
my thought was to upgrade the driver to the latest ODBC driver.

When I reference the new JDBC driver, and Lucee is unable to detect the
dialect type automatically.

My hope is the error I was getting is caused by the driver and NOT lucee.

Jeremy R. DeYoung
LunarFly.com http://www.lunarfly.com/615.261.8201@Jeremy_R_DeYoung1 <@Jeremy_R_DeYoung1>

On Sat, Feb 6, 2016 at 6:49 PM, Jeremy R. DeYoung < @Jeremy_R_DeYoung1> wrote:

How do I specify multiple orm dialects? I’m running two different kinds of
database servers. One is mysql and the other is microsoft sql server. How
do I get Lucee to read both database’s dialects?

I’m guessing that Lucee will not support this. Its just going to get way
too messy. The ORM setup in lucee is going to create all the associated
hibernate underpinnings for you, including things like the Transaction
Manger. To use two different datasources you’d need two separate
transaction managers, so when you wrap ORM calls in a transaction{} its
going to get really messy.

It may of been fixed, but Lucee did have issues using ORM and SQL inside
the same transaction so doing multiple ORM dialects is likely never going
to happen.On Wed, 10 Feb 2016 at 18:47 Jeremy R DeYoung <@Jeremy_R_DeYoung1> wrote:

anyone know how to handle multiple dialects in lucee for two database
types? MySQL and Microsoft SQL Server.

I tried something like this in my application.cfc but it does not respect
this.

  • this.datasources[“a”] = {*

  • class: ‘com.microsoft.jdbc.sqlserver.SQLServerDriver’*

  • , connectionString:
    ‘jdbc:sqlserver://0.0.0.0:1433;DATABASENAME=data;sendStringParametersAsUnicode=true;SelectMethod=direct;useUnicode=true;characterEncoding=UTF-8’*

  • , connectionLimit:25 // default:-1*

  • , connectionTimeout:1 // default: 1; unit: seconds*

  •                    , dialect: "MicrosoftSQLServer"*
    
  • };*

  •    this.datasources["b"] = {*
    
  •              class: 'org.gjt.mm.mysql.Driver'*
    
  •            , connectionString:
    

‘jdbc:mysql://0.0.0.0:3306/data?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true
http://0.0.0.0:3306/data?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true’*

  •            , dialect: "MySQLwithInnoDB"*
    
  •    };*
    

It only understands this.ormSettings.dialect = “MicrosoftSQLServer” which
creates a problem when having two database types.

I ask this question b/c I’m trying to fix another issue in a previous
email i sent a few minutes ago with database driver returning random
errors. So my thought was to upgrade the driver to the latest ODBC driver.

When I reference the new JDBC driver, and Lucee is unable to detect the
dialect type automatically.

My hope is the error I was getting is caused by the driver and NOT lucee.

Jeremy R. DeYoung
615.261.8201@Jeremy_R_DeYoung1
<@Jeremy_R_DeYoung1> • LunarFly.com http://www.lunarfly.com/

On Sat, Feb 6, 2016 at 6:49 PM, Jeremy R. DeYoung < @Jeremy_R_DeYoung1> wrote:

How do I specify multiple orm dialects? I’m running two different kinds
of database servers. One is mysql and the other is microsoft sql server.
How do I get Lucee to read both database’s dialects?


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html

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+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/CAFy17u%3DdS%2BckoPOeJ%3DXAOLsRok6YfK0SDeiMXriuhx9-xh%3Dq8g%40mail.gmail.com
https://groups.google.com/d/msgid/lucee/CAFy17u%3DdS%2BckoPOeJ%3DXAOLsRok6YfK0SDeiMXriuhx9-xh%3Dq8g%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.