I'm not sure whether it is just me, but I seem to be stumbling on the
Scala compiler exceptions whatever I do. First there was one when
creating specs that I mailed earlier, and now I get compile problems
when I changed Boot-class.

I have changed Boot-class as follows. Idea is to allow different
database based on runlevel and also cleaning up the tables when doing
tests. I have tried to change models to List[KeyedMapper[Any, Any]]
but then I just get different set of exceptions. If I expand models by
hand to schemify and cleanTables, it works just fine. Should I just
send report to scala lang -list or am I doing something wrong?

class Boot {
  def database = ("org.apache.derby.jdbc.EmbeddedDriver",
"jdbc:derby:liftdb_"+Props.mode.toString.toLowerCase+";create=true")

  def dbVendor = new ConnectionManager {
    def newConnection(name: ConnectionIdentifier): Can[Connection] = {
      try {
        val (driver, databaseString) = database
        Class.forName(driver)
        Full(DriverManager.getConnection(databaseString))
      } catch {
        case e : Exception => e.printStackTrace; Empty
      }
    }
    def releaseConnection(conn: Connection) {conn.close}
  }

  val models = List(User, Game, GameUser, Hull, Ship, StarSystem)

  def schemify {
    models foreach {
      m => Schemifier.schemify(true, Log.infoF _, m)
    }
  }

  def cleanTables {
    models foreach {
      m => m.bulkDelete_!!()
    }
  }

  def boot {
    Log.info("Running boot at runmode "+ Props.mode)
    if (!DB.jndiJdbcConnAvailable_?) DB.defineConnectionManager
(DefaultConnectionIdentifier, dbVendor)

    Props.mode match {
      case Props.RunModes.Development =>
        schemify
      case Props.RunModes.Test =>
        schemify
        cleanTables
      case _ =>
    }
...


I get this kind of stack trace:

[WARNING] Exception in thread "main" java.lang.OutOfMemoryError: Java
heap space
[WARNING]       at scala.tools.nsc.util.HashSet.growTable
(HashSet.scala:58)
[WARNING]       at scala.tools.nsc.util.HashSet.addEntry(HashSet.scala:
41)
[WARNING]       at scala.tools.nsc.symtab.Types$class.unique
(Types.scala:2221)
[WARNING]       at scala.tools.nsc.symtab.Types$class.mkThisType
(Types.scala:1910)
[WARNING]       at scala.tools.nsc.symtab.SymbolTable.mkThisType
(SymbolTable.scala:12)
[WARNING]       at scala.tools.nsc.symtab.Symbols$ClassSymbol.thisType
(Symbols.scala:1540)
[WARNING]       at scala.tools.nsc.symtab.Types$class.copyRefinedType
(Types.scala:1986)
[WARNING]       at scala.tools.nsc.symtab.SymbolTable.copyRefinedType
(SymbolTable.scala:12)
[WARNING]       at scala.tools.nsc.symtab.Types$TypeMap.mapOver
(Types.scala:2324)
[WARNING]       at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply
(Types.scala:2708)
[WARNING]       at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply
(Types.scala:2575)
[WARNING]       at scala.tools.nsc.symtab.Types$TypeMap.mapOver
(Types.scala:2343)
[WARNING]       at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply
(Types.scala:2708)
[WARNING]       at scala.tools.nsc.symtab.Types$Type.asSeenFrom
(Types.scala:399)
[WARNING]       at scala.tools.nsc.symtab.Types$Type.memberType
(Types.scala:429)
[WARNING]       at scala.tools.nsc.symtab.Types$Type.findMember
(Types.scala:696)
[WARNING]       at scala.tools.nsc.symtab.Types$Type.nonPrivateMember
(Types.scala:378)
[WARNING]       at scala.tools.nsc.symtab.Types$$anonfun$29.apply
(Types.scala:3984)
[WARNING]       at scala.tools.nsc.symtab.Types$$anonfun$29.apply
(Types.scala:3983)
[WARNING]       at scala.List.map(List.scala:805)
[WARNING]       at scala.tools.nsc.symtab.Types$class.lubsym$1
(Types.scala:3983)
[WARNING]       at scala.tools.nsc.symtab.Types$$anonfun$31.apply
(Types.scala:4015)
[WARNING]       at scala.tools.nsc.symtab.Types$$anonfun$31.apply
(Types.scala:4010)
[WARNING]       at scala.List.foreach(List.scala:834)
[WARNING]       at scala.tools.nsc.symtab.Types$class.lub0$1
(Types.scala:4010)
[WARNING]       at scala.tools.nsc.symtab.Types$class.lub(Types.scala:
4034)
[WARNING]       at scala.tools.nsc.symtab.SymbolTable.lub
(SymbolTable.scala:12)
[WARNING]       at scala.tools.nsc.symtab.Types$$anonfun$41.apply
(Types.scala:4180)
[WARNING]       at scala.tools.nsc.symtab.Types$$anonfun$41.apply
(Types.scala:4171)
[WARNING]       at scala.List$.map2(List.scala:326)
[WARNING]       at scala.tools.nsc.symtab.Types
$class.mergePrefixAndArgs(Types.scala:4170)
[WARNING]       at
scala.tools.nsc.symtab.SymbolTable.mergePrefixAndArgs
(SymbolTable.scala:12)

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

Reply via email to