Re: mysql error when upgrade from 1.8 to 1.10

2015-11-25 Thread Dan Haywood
OK, James, thanks for this.

So I guess you are saying it worked, but it's a bit annoying to have to
write out all the XML just to override one small detail.

To improve things a little, I've just hacked together [1] a little mixin
utility (mixins were introduced in 1.10.0) that allows the XML equivalent
version of any domain entity to be downloaded.  It's documented here [2]
and here [3], the code is here [4]. Assuming you are on 1.10.0, you should
just be able to copy-n-paste the mixin into your source code, and ensure
that the package that the mixin resides in listed in the app manifest.  If
on 1.9.0 or earlier, then rewrite as a contributed action on a regular
domain service.

HTH
Dan

[1] https://issues.apache.org/jira/browse/ISIS-1262
[2] http://isis.apache.org/guides/rg.html#_rg_classes_mixins_Persistable
[3]
http://isis.apache.org/guides/ug.html#_ug_more-advanced_overriding-jdo-annotations
[4]
https://github.com/apache/isis/blob/302da22ce3f5e549cda6c137c387cafd637ace55/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/jdosupport/Persistable_downloadJdoMetadata.java






On 25 November 2015 at 02:19, Chuangyu  wrote:

> Dan,
>
> I try it follow your way. but it seems need put all name query into
> package.jdo.
> otherwise it prompt errors as follow:
>
> javax.jdo.JDOUserException: Query "findByRoleAndRuleAndFeature" for class
> "class org.isisaddons.module.security.dom.permission.ApplicationPermission"
> was not found!
>
> If put one query into package.jdo, it will not show error of this query,
> but show others which were not in file.
>
> This is my package.jod file content:
>
> 
> http://xmlns.jcp.org/xml/ns/jdo/jdo";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdo
> http://xmlns.jcp.org/xml/ns/jdo/jdo_3_0.xsd"; version="3.0">
>
> 
>   schema="xxx"
>  table="IsisSecurityApplicationUser">
>
> 
> 
> 
>   schema="xxx"
>  table="IsisSecurityApplicationTenancy">
> 
> SELECT FROM
> org.isisaddons.module.security.dom.tenancy.ApplicationTenancy WHERE name ==
> :name
> 
> 
> 
> 
>   schema="xxx"
>  table="IsisSecurityApplicationPermission">
> 
> 
> 
>   schema="xxx"
>  table="IsisSecurityApplicationRole">
> 
> SELECT FROM org.isisaddons.module.security.dom.role.ApplicationRole
> WHERE name == :name
> 
> 
> 
> 
>   schema="xxx"
>  table="IsisCommand">
> 
> 
> 
>   schema="xxx"
>  table="isisSessionLogEntry">
> 
> 
> 
>
> Thanks,
>
> James
>
>
> 2015-11-19 22:40 GMT+08:00 Dan Haywood :
>
> > Hi James,
> >
> > With DataNucleus the metadata can be specified either in XML or in
> > annotations.  (I haven't tried this out, but my understanding is that)...
> > if both are present, then the XML files take precedence over any
> > annotations.
> >
> >
> > So, in this case, we have the following source (abbreviated):
> >
> > package org.isisaddons.module.security.dom.user;
> > @javax.jdo.annotations.PersistenceCapable(
> > identityType = IdentityType.DATASTORE,
> > schema = "isissecurity",
> > table = "ApplicationUser")
> > public class ApplicationUser ... { ... }
> >
> >
> > So, you should be able to create META-INF/package.jdo file:
> >
> >
> > 
> > http://xmlns.jcp.org/xml/ns/jdo/jdo";
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdo
> > http://xmlns.jcp.org/xml/ns/jdo/jdo_3_0.xsd"; version="3.0">
> >
> > 
> >  >  schema="xxx"
> >   
> >  table="IsisSecurityApplicationUser">
> > 
> > 
> > 
> >
> >
> > There are lots of other ways of splitting out and providing this XML
> > metadata; see the docs below.
> >
> > Let us know how you get on; if it works I'll add to the hints/tips on our
> > website.
> >
> > Thx
> > Dan
> >
> > http://www.datanucleus.org/products/accessplatform_4_1/jdo/metadata.html
> >
> >
> http://www.datanucleus.org/products/accessplatform_4_1/jdo/metadata_xml.html#class
> >
> >
> http://www.datanucleus.org/products/accessplatform_4_1/jdo/class_mapping.html
> >
> >
> > On 19 November 2015 at 14:25, Chuangyu  wrote:
> >
> > > Thank you, Jeroen.
> > >
> > > If do not create schema manually, it can run so far, just ignore
> "create
> > > schema" errors.
> > >
> > > MySQL official document comment:
> > > CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2
> > >
> > > I don't want to create separate database for isis addons.
> > >
> > >
> > > James
> > >
> > > 2015-11-16 23:51 GMT+08:00 Jeroe

Re: mysql error when upgrade from 1.8 to 1.10

2015-11-24 Thread Chuangyu
Dan,

I try it follow your way. but it seems need put all name query into
package.jdo.
otherwise it prompt errors as follow:

javax.jdo.JDOUserException: Query "findByRoleAndRuleAndFeature" for class
"class org.isisaddons.module.security.dom.permission.ApplicationPermission"
was not found!

If put one query into package.jdo, it will not show error of this query,
but show others which were not in file.

This is my package.jod file content:


http://xmlns.jcp.org/xml/ns/jdo/jdo";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdo
http://xmlns.jcp.org/xml/ns/jdo/jdo_3_0.xsd"; version="3.0">









SELECT FROM
org.isisaddons.module.security.dom.tenancy.ApplicationTenancy WHERE name ==
:name










SELECT FROM org.isisaddons.module.security.dom.role.ApplicationRole
WHERE name == :name













Thanks,

James


2015-11-19 22:40 GMT+08:00 Dan Haywood :

> Hi James,
>
> With DataNucleus the metadata can be specified either in XML or in
> annotations.  (I haven't tried this out, but my understanding is that)...
> if both are present, then the XML files take precedence over any
> annotations.
>
>
> So, in this case, we have the following source (abbreviated):
>
> package org.isisaddons.module.security.dom.user;
> @javax.jdo.annotations.PersistenceCapable(
> identityType = IdentityType.DATASTORE,
> schema = "isissecurity",
> table = "ApplicationUser")
> public class ApplicationUser ... { ... }
>
>
> So, you should be able to create META-INF/package.jdo file:
>
>
> 
> http://xmlns.jcp.org/xml/ns/jdo/jdo";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdo
> http://xmlns.jcp.org/xml/ns/jdo/jdo_3_0.xsd"; version="3.0">
>
> 
>   schema="xxx"
>   
>  table="IsisSecurityApplicationUser">
> 
> 
> 
>
>
> There are lots of other ways of splitting out and providing this XML
> metadata; see the docs below.
>
> Let us know how you get on; if it works I'll add to the hints/tips on our
> website.
>
> Thx
> Dan
>
> http://www.datanucleus.org/products/accessplatform_4_1/jdo/metadata.html
>
> http://www.datanucleus.org/products/accessplatform_4_1/jdo/metadata_xml.html#class
>
> http://www.datanucleus.org/products/accessplatform_4_1/jdo/class_mapping.html
>
>
> On 19 November 2015 at 14:25, Chuangyu  wrote:
>
> > Thank you, Jeroen.
> >
> > If do not create schema manually, it can run so far, just ignore "create
> > schema" errors.
> >
> > MySQL official document comment:
> > CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2
> >
> > I don't want to create separate database for isis addons.
> >
> >
> > James
> >
> > 2015-11-16 23:51 GMT+08:00 Jeroen van der Wal :
> >
> > > We actively use Apache Isis with HSQLDB, PostgreSQL and MS SQL Server
> and
> > > they all support separate schemas within the same database. I would
> like
> > to
> > > see Apache Isis run without issues in the scenario you have but I don't
> > > want to lose the security that database schemas provide in preventing
> > > similar named entities to clash.
> > >
> > > What options do you have? Can you
> > >
> > > On 16 November 2015 at 14:40, Chuangyu  wrote:
> > >
> > > > Hi Jeroen and Stephen,
> > > > Thanks for your response.
> > > > Jeroen ,your solution may not fit my scenario.
> > > > I run 3 instance of this system but all 3 databases on one server
> .(eg.
> > > >  db1,db2,db3)
> > > > Each instance has username/password separately.(eg, user1, user2,
> > user3)
> > > > If create schema on this server , all databases would share the
> schema.
> > > >
> > > > If tables will create in the default schema, as Stephen said, it may
> be
> > > can
> > > > work.
> > > > But it is hard to maintenance.
> > > >
> > > >
> > > > James.
> > > >
> > > >
> > > > 2015-11-16 19:27 GMT+08:00 Stephen Cameron <
> steve.cameron...@gmail.com
> > >:
> > > >
> > > > > Yes, that was a problem for me with MySQL and I used the same
> > solution
> > > to
> > > > > manually create the schemas, but then the module tables seem to
> have
> > > been
> > > > > created in the default schema anyway, so presently a mystery!
> > > > >
> > > > > On Mon, Nov 16, 2015 at 10:22 PM, Jeroen van der Wal <
> > > > jer...@stromboli.it>
> > > > > wrote:
> > > > >
> > > > > > Hi James,
> > > > > >
> > > > > > Starting with Isis 1.10.0 we've moved the tables of the modules
> to
> > > > their
> > > > > > own database schema to avoid clashes with similar named entities
> in
> > > > your
> > > > > > own domain or other modules. Here's [1] a sample of an MSSQL
> script
> > > > that
> > > > > we
> > > > > > used. You have create something similar for MySQL I guess

Re: mysql error when upgrade from 1.8 to 1.10

2015-11-19 Thread Dan Haywood
Hi James,

With DataNucleus the metadata can be specified either in XML or in
annotations.  (I haven't tried this out, but my understanding is that)...
if both are present, then the XML files take precedence over any
annotations.


So, in this case, we have the following source (abbreviated):

package org.isisaddons.module.security.dom.user;
@javax.jdo.annotations.PersistenceCapable(
identityType = IdentityType.DATASTORE,
schema = "isissecurity",
table = "ApplicationUser")
public class ApplicationUser ... { ... }


So, you should be able to create META-INF/package.jdo file:



http://xmlns.jcp.org/xml/ns/jdo/jdo";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdo
http://xmlns.jcp.org/xml/ns/jdo/jdo_3_0.xsd"; version="3.0">



 table="IsisSecurityApplicationUser">





There are lots of other ways of splitting out and providing this XML
metadata; see the docs below.

Let us know how you get on; if it works I'll add to the hints/tips on our
website.

Thx
Dan

http://www.datanucleus.org/products/accessplatform_4_1/jdo/metadata.html
http://www.datanucleus.org/products/accessplatform_4_1/jdo/metadata_xml.html#class
http://www.datanucleus.org/products/accessplatform_4_1/jdo/class_mapping.html


On 19 November 2015 at 14:25, Chuangyu  wrote:

> Thank you, Jeroen.
>
> If do not create schema manually, it can run so far, just ignore "create
> schema" errors.
>
> MySQL official document comment:
> CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2
>
> I don't want to create separate database for isis addons.
>
>
> James
>
> 2015-11-16 23:51 GMT+08:00 Jeroen van der Wal :
>
> > We actively use Apache Isis with HSQLDB, PostgreSQL and MS SQL Server and
> > they all support separate schemas within the same database. I would like
> to
> > see Apache Isis run without issues in the scenario you have but I don't
> > want to lose the security that database schemas provide in preventing
> > similar named entities to clash.
> >
> > What options do you have? Can you
> >
> > On 16 November 2015 at 14:40, Chuangyu  wrote:
> >
> > > Hi Jeroen and Stephen,
> > > Thanks for your response.
> > > Jeroen ,your solution may not fit my scenario.
> > > I run 3 instance of this system but all 3 databases on one server .(eg.
> > >  db1,db2,db3)
> > > Each instance has username/password separately.(eg, user1, user2,
> user3)
> > > If create schema on this server , all databases would share the schema.
> > >
> > > If tables will create in the default schema, as Stephen said, it may be
> > can
> > > work.
> > > But it is hard to maintenance.
> > >
> > >
> > > James.
> > >
> > >
> > > 2015-11-16 19:27 GMT+08:00 Stephen Cameron  >:
> > >
> > > > Yes, that was a problem for me with MySQL and I used the same
> solution
> > to
> > > > manually create the schemas, but then the module tables seem to have
> > been
> > > > created in the default schema anyway, so presently a mystery!
> > > >
> > > > On Mon, Nov 16, 2015 at 10:22 PM, Jeroen van der Wal <
> > > jer...@stromboli.it>
> > > > wrote:
> > > >
> > > > > Hi James,
> > > > >
> > > > > Starting with Isis 1.10.0 we've moved the tables of the modules to
> > > their
> > > > > own database schema to avoid clashes with similar named entities in
> > > your
> > > > > own domain or other modules. Here's [1] a sample of an MSSQL script
> > > that
> > > > we
> > > > > used. You have create something similar for MySQL I guess.
> > > > >
> > > > > Looking at the error message I also suspect that the automatic
> > creation
> > > > of
> > > > > schemas does not work on MySQL, perhaps it requires delimiters
> around
> > > the
> > > > > schema name? Try creating the schemas manually as a workaround.
> > > > >
> > > > > [1] https://gist.github.com/jcvanderwal/c30e2d8c4d11aec5b0c0
> > > > >
> > > > >
> > > > > On 16 November 2015 at 11:10, Chuangyu 
> > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I create a new 1.10 simple app and copy all code from 1.8 to
> 1.10.
> > > > > > And made some change to fit new 1.10 specs.
> > > > > > When start system , Eclipse show errors on console box.
> > > > > > It seems each addon module occur one error.
> > > > > > Below is one of errors:
> > > > > >
> > > > > > Unable to create schema
> > > > > > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
> have
> > > an
> > > > > > error in your SQL syntax; check the manual that corresponds to
> your
> > > > MySQL
> > > > > > server version for the right syntax to use near
> > '"isissessionlogger"'
> > > > at
> > > > > > line 1
> > > > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > > Method)
> > > > > > at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> > > > > > at
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> sun.ref

Re: mysql error when upgrade from 1.8 to 1.10

2015-11-19 Thread Chuangyu
Thank you, Jeroen.

If do not create schema manually, it can run so far, just ignore "create
schema" errors.

MySQL official document comment:
CREATE SCHEMA is a synonym for CREATE DATABASE as of MySQL 5.0.2

I don't want to create separate database for isis addons.


James

2015-11-16 23:51 GMT+08:00 Jeroen van der Wal :

> We actively use Apache Isis with HSQLDB, PostgreSQL and MS SQL Server and
> they all support separate schemas within the same database. I would like to
> see Apache Isis run without issues in the scenario you have but I don't
> want to lose the security that database schemas provide in preventing
> similar named entities to clash.
>
> What options do you have? Can you
>
> On 16 November 2015 at 14:40, Chuangyu  wrote:
>
> > Hi Jeroen and Stephen,
> > Thanks for your response.
> > Jeroen ,your solution may not fit my scenario.
> > I run 3 instance of this system but all 3 databases on one server .(eg.
> >  db1,db2,db3)
> > Each instance has username/password separately.(eg, user1, user2, user3)
> > If create schema on this server , all databases would share the schema.
> >
> > If tables will create in the default schema, as Stephen said, it may be
> can
> > work.
> > But it is hard to maintenance.
> >
> >
> > James.
> >
> >
> > 2015-11-16 19:27 GMT+08:00 Stephen Cameron :
> >
> > > Yes, that was a problem for me with MySQL and I used the same solution
> to
> > > manually create the schemas, but then the module tables seem to have
> been
> > > created in the default schema anyway, so presently a mystery!
> > >
> > > On Mon, Nov 16, 2015 at 10:22 PM, Jeroen van der Wal <
> > jer...@stromboli.it>
> > > wrote:
> > >
> > > > Hi James,
> > > >
> > > > Starting with Isis 1.10.0 we've moved the tables of the modules to
> > their
> > > > own database schema to avoid clashes with similar named entities in
> > your
> > > > own domain or other modules. Here's [1] a sample of an MSSQL script
> > that
> > > we
> > > > used. You have create something similar for MySQL I guess.
> > > >
> > > > Looking at the error message I also suspect that the automatic
> creation
> > > of
> > > > schemas does not work on MySQL, perhaps it requires delimiters around
> > the
> > > > schema name? Try creating the schemas manually as a workaround.
> > > >
> > > > [1] https://gist.github.com/jcvanderwal/c30e2d8c4d11aec5b0c0
> > > >
> > > >
> > > > On 16 November 2015 at 11:10, Chuangyu 
> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I create a new 1.10 simple app and copy all code from 1.8 to 1.10.
> > > > > And made some change to fit new 1.10 specs.
> > > > > When start system , Eclipse show errors on console box.
> > > > > It seems each addon module occur one error.
> > > > > Below is one of errors:
> > > > >
> > > > > Unable to create schema
> > > > > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have
> > an
> > > > > error in your SQL syntax; check the manual that corresponds to your
> > > MySQL
> > > > > server version for the right syntax to use near
> '"isissessionlogger"'
> > > at
> > > > > line 1
> > > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > > Method)
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> > > > > at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
> > > > > at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
> > > > > at com.mysql.jdbc.Util.getInstance(Util.java:383)
> > > > > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
> > > > > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
> > > > > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
> > > > > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
> > > > > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
> > > > > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
> > > > > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2783)
> > > > > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:908)
> > > > > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:788)
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.exec(CreateSchemaObjectFromClassMetadata.java:117)
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.loaded(CreateSchemaObjectFromClassMetadata.java:76)
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.processListenerLoadingCall(MetaDataManagerImpl.java:1705)
> > > > > at
> > > > >
> > > > >
> > > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1681)
> > > 

Re: mysql error when upgrade from 1.8 to 1.10

2015-11-16 Thread Jeroen van der Wal
We actively use Apache Isis with HSQLDB, PostgreSQL and MS SQL Server and
they all support separate schemas within the same database. I would like to
see Apache Isis run without issues in the scenario you have but I don't
want to lose the security that database schemas provide in preventing
similar named entities to clash.

What options do you have? Can you

On 16 November 2015 at 14:40, Chuangyu  wrote:

> Hi Jeroen and Stephen,
> Thanks for your response.
> Jeroen ,your solution may not fit my scenario.
> I run 3 instance of this system but all 3 databases on one server .(eg.
>  db1,db2,db3)
> Each instance has username/password separately.(eg, user1, user2, user3)
> If create schema on this server , all databases would share the schema.
>
> If tables will create in the default schema, as Stephen said, it may be can
> work.
> But it is hard to maintenance.
>
>
> James.
>
>
> 2015-11-16 19:27 GMT+08:00 Stephen Cameron :
>
> > Yes, that was a problem for me with MySQL and I used the same solution to
> > manually create the schemas, but then the module tables seem to have been
> > created in the default schema anyway, so presently a mystery!
> >
> > On Mon, Nov 16, 2015 at 10:22 PM, Jeroen van der Wal <
> jer...@stromboli.it>
> > wrote:
> >
> > > Hi James,
> > >
> > > Starting with Isis 1.10.0 we've moved the tables of the modules to
> their
> > > own database schema to avoid clashes with similar named entities in
> your
> > > own domain or other modules. Here's [1] a sample of an MSSQL script
> that
> > we
> > > used. You have create something similar for MySQL I guess.
> > >
> > > Looking at the error message I also suspect that the automatic creation
> > of
> > > schemas does not work on MySQL, perhaps it requires delimiters around
> the
> > > schema name? Try creating the schemas manually as a workaround.
> > >
> > > [1] https://gist.github.com/jcvanderwal/c30e2d8c4d11aec5b0c0
> > >
> > >
> > > On 16 November 2015 at 11:10, Chuangyu  wrote:
> > >
> > > > Hi,
> > > >
> > > > I create a new 1.10 simple app and copy all code from 1.8 to 1.10.
> > > > And made some change to fit new 1.10 specs.
> > > > When start system , Eclipse show errors on console box.
> > > > It seems each addon module occur one error.
> > > > Below is one of errors:
> > > >
> > > > Unable to create schema
> > > > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have
> an
> > > > error in your SQL syntax; check the manual that corresponds to your
> > MySQL
> > > > server version for the right syntax to use near '"isissessionlogger"'
> > at
> > > > line 1
> > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> > > > at
> > > >
> > > >
> > >
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> > > > at
> > > >
> > > >
> > >
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> > > > at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
> > > > at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
> > > > at com.mysql.jdbc.Util.getInstance(Util.java:383)
> > > > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
> > > > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
> > > > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
> > > > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
> > > > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
> > > > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
> > > > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2783)
> > > > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:908)
> > > > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:788)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.exec(CreateSchemaObjectFromClassMetadata.java:117)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.loaded(CreateSchemaObjectFromClassMetadata.java:76)
> > > > at
> > > >
> > > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.processListenerLoadingCall(MetaDataManagerImpl.java:1705)
> > > > at
> > > >
> > > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1681)
> > > > at
> > > >
> > > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1580)
> > > > at
> > > >
> > > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getReferencedClasses(MetaDataManagerImpl.java:3009)
> > > > at
> > > >
> > > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2981)
> > > > at
> > > >
> > > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
> > > > at
> > > >
> > > >
> > >
> >
> org.datanucleus.store

Re: mysql error when upgrade from 1.8 to 1.10

2015-11-16 Thread Chuangyu
Hi Jeroen and Stephen,
Thanks for your response.
Jeroen ,your solution may not fit my scenario.
I run 3 instance of this system but all 3 databases on one server .(eg.
 db1,db2,db3)
Each instance has username/password separately.(eg, user1, user2, user3)
If create schema on this server , all databases would share the schema.

If tables will create in the default schema, as Stephen said, it may be can
work.
But it is hard to maintenance.


James.


2015-11-16 19:27 GMT+08:00 Stephen Cameron :

> Yes, that was a problem for me with MySQL and I used the same solution to
> manually create the schemas, but then the module tables seem to have been
> created in the default schema anyway, so presently a mystery!
>
> On Mon, Nov 16, 2015 at 10:22 PM, Jeroen van der Wal 
> wrote:
>
> > Hi James,
> >
> > Starting with Isis 1.10.0 we've moved the tables of the modules to their
> > own database schema to avoid clashes with similar named entities in your
> > own domain or other modules. Here's [1] a sample of an MSSQL script that
> we
> > used. You have create something similar for MySQL I guess.
> >
> > Looking at the error message I also suspect that the automatic creation
> of
> > schemas does not work on MySQL, perhaps it requires delimiters around the
> > schema name? Try creating the schemas manually as a workaround.
> >
> > [1] https://gist.github.com/jcvanderwal/c30e2d8c4d11aec5b0c0
> >
> >
> > On 16 November 2015 at 11:10, Chuangyu  wrote:
> >
> > > Hi,
> > >
> > > I create a new 1.10 simple app and copy all code from 1.8 to 1.10.
> > > And made some change to fit new 1.10 specs.
> > > When start system , Eclipse show errors on console box.
> > > It seems each addon module occur one error.
> > > Below is one of errors:
> > >
> > > Unable to create schema
> > > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an
> > > error in your SQL syntax; check the manual that corresponds to your
> MySQL
> > > server version for the right syntax to use near '"isissessionlogger"'
> at
> > > line 1
> > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> > > at
> > >
> > >
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> > > at
> > >
> > >
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> > > at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
> > > at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
> > > at com.mysql.jdbc.Util.getInstance(Util.java:383)
> > > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
> > > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
> > > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
> > > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
> > > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
> > > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
> > > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2783)
> > > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:908)
> > > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:788)
> > > at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.exec(CreateSchemaObjectFromClassMetadata.java:117)
> > > at
> > >
> > >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.loaded(CreateSchemaObjectFromClassMetadata.java:76)
> > > at
> > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.processListenerLoadingCall(MetaDataManagerImpl.java:1705)
> > > at
> > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1681)
> > > at
> > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1580)
> > > at
> > >
> > >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getReferencedClasses(MetaDataManagerImpl.java:3009)
> > > at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2981)
> > > at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
> > > at
> > >
> > >
> >
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
> > > at
> > >
> > >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
> > > at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:191)
> > > at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:150)
> > > at
> > >
> > >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:105)
> > >

Re: mysql error when upgrade from 1.8 to 1.10

2015-11-16 Thread Stephen Cameron
Yes, that was a problem for me with MySQL and I used the same solution to
manually create the schemas, but then the module tables seem to have been
created in the default schema anyway, so presently a mystery!

On Mon, Nov 16, 2015 at 10:22 PM, Jeroen van der Wal 
wrote:

> Hi James,
>
> Starting with Isis 1.10.0 we've moved the tables of the modules to their
> own database schema to avoid clashes with similar named entities in your
> own domain or other modules. Here's [1] a sample of an MSSQL script that we
> used. You have create something similar for MySQL I guess.
>
> Looking at the error message I also suspect that the automatic creation of
> schemas does not work on MySQL, perhaps it requires delimiters around the
> schema name? Try creating the schemas manually as a workaround.
>
> [1] https://gist.github.com/jcvanderwal/c30e2d8c4d11aec5b0c0
>
>
> On 16 November 2015 at 11:10, Chuangyu  wrote:
>
> > Hi,
> >
> > I create a new 1.10 simple app and copy all code from 1.8 to 1.10.
> > And made some change to fit new 1.10 specs.
> > When start system , Eclipse show errors on console box.
> > It seems each addon module occur one error.
> > Below is one of errors:
> >
> > Unable to create schema
> > com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an
> > error in your SQL syntax; check the manual that corresponds to your MySQL
> > server version for the right syntax to use near '"isissessionlogger"' at
> > line 1
> > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> > at
> >
> >
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> > at
> >
> >
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
> > at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
> > at com.mysql.jdbc.Util.getInstance(Util.java:383)
> > at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
> > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
> > at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
> > at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
> > at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
> > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
> > at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2783)
> > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:908)
> > at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:788)
> > at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.exec(CreateSchemaObjectFromClassMetadata.java:117)
> > at
> >
> >
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.loaded(CreateSchemaObjectFromClassMetadata.java:76)
> > at
> >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.processListenerLoadingCall(MetaDataManagerImpl.java:1705)
> > at
> >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1681)
> > at
> >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1580)
> > at
> >
> >
> org.datanucleus.metadata.MetaDataManagerImpl.getReferencedClasses(MetaDataManagerImpl.java:3009)
> > at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2981)
> > at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
> > at
> >
> >
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
> > at
> >
> >
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
> > at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:191)
> > at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:150)
> > at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:105)
> > at
> >
> >
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.(DataNucleusApplicationComponents.java:98)
> > at
> >
> >
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createDataNucleusApplicationComponents(PersistenceSessionFactory.java:92)
> > at
> >
> >
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.init(PersistenceSessionFactory.java:73)
> > at
> org.apache.isis.core.runtime.system.IsisSystem.init(IsisSystem.java:203)
> > at
> >
> >
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:140)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invo

Re: mysql error when upgrade from 1.8 to 1.10

2015-11-16 Thread Jeroen van der Wal
Hi James,

Starting with Isis 1.10.0 we've moved the tables of the modules to their
own database schema to avoid clashes with similar named entities in your
own domain or other modules. Here's [1] a sample of an MSSQL script that we
used. You have create something similar for MySQL I guess.

Looking at the error message I also suspect that the automatic creation of
schemas does not work on MySQL, perhaps it requires delimiters around the
schema name? Try creating the schemas manually as a workaround.

[1] https://gist.github.com/jcvanderwal/c30e2d8c4d11aec5b0c0


On 16 November 2015 at 11:10, Chuangyu  wrote:

> Hi,
>
> I create a new 1.10 simple app and copy all code from 1.8 to 1.10.
> And made some change to fit new 1.10 specs.
> When start system , Eclipse show errors on console box.
> It seems each addon module occur one error.
> Below is one of errors:
>
> Unable to create schema
> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an
> error in your SQL syntax; check the manual that corresponds to your MySQL
> server version for the right syntax to use near '"isissessionlogger"' at
> line 1
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
>
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
>
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:408)
> at com.mysql.jdbc.Util.getInstance(Util.java:383)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2783)
> at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:908)
> at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:788)
> at
>
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.exec(CreateSchemaObjectFromClassMetadata.java:117)
> at
>
> org.apache.isis.objectstore.jdo.datanucleus.CreateSchemaObjectFromClassMetadata.loaded(CreateSchemaObjectFromClassMetadata.java:76)
> at
>
> org.datanucleus.metadata.MetaDataManagerImpl.processListenerLoadingCall(MetaDataManagerImpl.java:1705)
> at
>
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1681)
> at
>
> org.datanucleus.metadata.MetaDataManagerImpl.getMetaDataForClass(MetaDataManagerImpl.java:1580)
> at
>
> org.datanucleus.metadata.MetaDataManagerImpl.getReferencedClasses(MetaDataManagerImpl.java:3009)
> at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.addClassTables(RDBMSStoreManager.java:2981)
> at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2872)
> at
>
> org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:119)
> at
>
> org.datanucleus.store.rdbms.RDBMSStoreManager.createSchemaForClasses(RDBMSStoreManager.java:3842)
> at
>
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createSchema(DataNucleusApplicationComponents.java:191)
> at
>
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.createPmfAndSchemaIfRequired(DataNucleusApplicationComponents.java:150)
> at
>
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.initialize(DataNucleusApplicationComponents.java:105)
> at
>
> org.apache.isis.core.runtime.system.persistence.DataNucleusApplicationComponents.(DataNucleusApplicationComponents.java:98)
> at
>
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.createDataNucleusApplicationComponents(PersistenceSessionFactory.java:92)
> at
>
> org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory.init(PersistenceSessionFactory.java:73)
> at org.apache.isis.core.runtime.system.IsisSystem.init(IsisSystem.java:203)
> at
>
> org.apache.isis.core.runtime.runner.IsisInjectModule.provideIsisSystem(IsisInjectModule.java:140)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:104)
> at
>
> com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
> at
>
> com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
> at
>
> com.google.in