cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Giaccone <tgiacc...@gmail.com>
Subject Re: H2 rev engineer
Date Fri, 20 Oct 2017 16:54:36 GMT
Mike & Andrus,

Thanks for your help you got me a bit closer.

So one step forward.. but not quite there.

So, here's the path now...

In the first shell:

$ java -cp bin/h2*.jar org.h2.tools.Server -tcp -tcpAllowOthers

In a second shell

java -cp h2*.jar org.h2.tools.RunScript -url
"jdbc:h2:tcp://localhost/mem:test" -user sa -script ../script.sql


This works. The SQL in the script.sql gets executed and I can connect with
Squirrel nwith the following URL:

jdbc:h2:tcp://localhost/mem:test;MVCC=TRUE

I can view the changes. New Schema's are present, new tables, selects
against the tables get the correct number of rows.  All done using Squirrel.

I then go to Cayenne Modeller and try to connect for rev engineering.

When I look at the log file, it's show's that it's connecting to the DB
succesfully...

Oct 20, 2017 12:45:58 PM INFO: Connecting to
'jdbc:h2:tcp://localhost/mem:test;MVCC=TRUE;' as 'sa'
Oct 20, 2017 12:45:58 PM INFO: +++ Connecting: SUCCESS.
Oct 20, 2017 12:45:58 PM INFO: Connecting to
'jdbc:h2:tcp://localhost/mem:test;MVCC=TRUE;' as 'sa'
Oct 20, 2017 12:45:58 PM INFO: +++ Connecting: SUCCESS.
Oct 20, 2017 12:45:58 PM INFO: Connecting to
'jdbc:h2:tcp://localhost/mem:test;MVCC=TRUE;' as 'sa'
Oct 20, 2017 12:45:58 PM INFO: +++ Connecting: SUCCESS.

But the modeller puts up a dialog:

Connection is broken: "unexpected status 16777216 [90067-192]

And that's it, nothing more happens.


Now I should also point out that Squirrel also puts up a dialog box on
connection:

Error occurred during task execution:
for input string: "127.0.0.1:9092"

But when I dismiss that error and examine the log file, it shows:

Caused by: java.lang.NumberFormatException: For input string: "
127.0.0.1:9092"
    at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:580)
    at java.lang.Integer.valueOf(Integer.java:740)
    at java.lang.Integer.decode(Integer.java:1197)
    at org.h2.tools.SimpleResultSet.getInt(SimpleResultSet.java:709)


But Squirrel continues on and manages to read the object tree and execute
SQL against the db.


Tony



On Fri, Oct 20, 2017 at 12:04 PM, Mike Kienenberger <mkienenb@gmail.com>
wrote:

> I see a couple of possible reasons:
>
> First I would guess that "jdbc:h2:mem" is creating a separate
> in-memory database rather than using your tcp-served db.
>
> Second, you might need to specify your non-standard schemas like as
> follows.
>
> Below is a url I use modified for what values you provided:
>
> jdbc:h2:tcp://localhost/<path-to-test>;AUTO_SERVER=TRUE;MVCC
> =TRUE;SCHEMA_SEARCH_PATH=CORE_OPERATION
>
> On Fri, Oct 20, 2017 at 11:55 AM, Tony Giaccone <tgiaccone@gmail.com>
> wrote:
> > I created an H2 database, using our standard SQL. Now I'd like to
> > rev-engineer that db with cayenne, but the schema doesn't show up in the
> > modeler.
> >
> > To reproduce this problem, I follow these steps:
> >
> > $ java -cp bin/h2*.jar org.h2.tools.Server -tcp -tcpAllowOthers
> >
> > this creates a H2 database.
> >
> > I connect with Squirrel SQL Client
> > driver: org.h2.Driver
> > URL: jdbc:h2:mem:test;MVCC=TRUE
> >
> > This connects to the H2 Db, where I execute
> >
> > CREATE SCHEMA IF NOT EXISTS CORE AUTHORIZATION SA;
> >
> > This creates the new schema which, when I refresh the tree in squirrel,
> is
> > displayed.
> >
> > I then try to rev-engineer with the cayenne modeler 4.1.M1
> >
> > Only two schema's show up in the modeler drop down, INFORMATION_SCHEMA
> and
> > PUBLIC the newly created  schema  CORE is not in the list.
> >
> >
> > Any Suggestions?
> >
> >
> > Tony Giaccone
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message