Two database are broken in 1.1-M8, works fine in 1.1-M7 .

0 views
Skip to first unread message

Neil.Lv

unread,
Jan 11, 2010, 10:05:55 AM1/11/10
to Lift
Hi all,

There is a problem when i upgrading the 1.1-M7 to 1.1-M8, the db
connection is broken.

I use two database connection in my app, it's broken in 1.1-M8.
###
object OneDB extends ConnectionIdentifier {
override def jndiName = "lift_proto"
}
object TwoDB extends ConnectionIdentifier {
override def jndiName = "lift_proto2"
}
###

The error message is:
###
HTTP ERROR 500

Problem accessing /. Reason:

Looking for Connection Identifier ConnectionIdentifier(lift) but
failed to find either a JNDI data source with the name lift or a lift
connection manager with the correct name
###

Maybe I missing something else configure in M8 that it's different
from M7.

The test demo address is : http://github.com/anim510/two_db_demo

Thanks for any help very much!

Cheers,
Neil

David Pollak

unread,
Jan 13, 2010, 12:35:39 AM1/13/10
to Lift
The problem with this code is you are using the same connection vendor
for both connection identifiers *and* you're not defining a vendor for
the DefaultConnectionIdentifier

Neil.Lv

unread,
Jan 13, 2010, 9:18:12 AM1/13/10
to Lift
Hi David,

I'm sorry about it that i write it wrong.

But I change the second DBVendor name to DBVendor_2, and it create
a db file named "lift_proto2.db.h2.db".
And it doesn't work, I add this method to the User model to specify
the default db connection.

###
override def dbDefaultConnectionIdentifier = bootstrap.liftweb.OneDB
###

I use this code in M7 and it's fine.

How can i define a vendor for the DefaultConnectionIdentifier in
M8?

Thank you very much!

Cheers,
Neil

On Jan 13, 1:35 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:

David Pollak

unread,
Jan 13, 2010, 11:43:51 PM1/13/10
to lif...@googlegroups.com
On Wed, Jan 13, 2010 at 6:18 AM, Neil.Lv <ani...@gmail.com> wrote:
Hi David,

  I'm sorry about it that i write it wrong.

  But I change the second DBVendor name to DBVendor_2, and it create
a db file named "lift_proto2.db.h2.db".
And it doesn't work, I add this method to the User model to specify
the default db connection.

###
override def dbDefaultConnectionIdentifier = bootstrap.liftweb.OneDB
###

  I use this code in M7 and it's fine.

  How can i define a vendor for the DefaultConnectionIdentifier in
M8?

The same way you define it in every version of Lift:
DB.defineConnectionManager(DefaultConnectionIdentifier, DBVendor)



 
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.






--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

Neil.Lv

unread,
Jan 14, 2010, 2:51:42 AM1/14/10
to Lift
David, Thank you very much!

It works now, I'm so sorry about that I didn't see the yak demo
yesterday .

:)

Cheers,
Neil

On Jan 14, 12:43 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:

> > liftweb+u...@googlegroups.com<liftweb%2Bunsu...@googlegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/liftweb?hl=en.
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net

> Beginning Scalahttp://www.apress.com/book/view/1430219890

Reply all
Reply to author
Forward
0 new messages