You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by Denis Signoretto <de...@intesys.it> on 2012/07/30 09:41:33 UTC

Allow Connector update the database schema without restart

Hi Syncopers,
 
at the moment if an external resource schema changes (e.g. column added or renamed),
the DB connector, can't see the changes until a Syncope restart (I'm wrong?). 
 
As a future improvement what do you think about a "db schema update" functionality for DB connector?
 
Regards,
Denis.

R: Allow Connector update the database schema without restart

Posted by Denis Signoretto <de...@intesys.it>.
Hi Francesco,
 
you did it before me. I was suspecting the issue happen after the first time.
 
Many thanks thanks,
Denis

-----Messaggio originale-----
Da: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
Inviato: lunedì 10 settembre 2012 18.49
A: syncope-user@incubator.apache.org
Oggetto: Re: Allow Connector update the database schema without restart


On 10/09/2012 16:01, Francesco Chicchiriccò wrote:


On 10/09/2012 09:38, Denis Signoretto wrote:


Hi Francesco,
 
probably yes it could be an issue related to ConnId Table Connector.
 
If you alter a table, for instance adding a column, and you try to update schema mapping on a existing resource
the structure of the table it's not reread and the new column cannot be associated until a JVM restart (this is the only solution I've found).


Denis,
I've run the following procedure:

1. generate a project from 1.0.2-incubating-SNAPSHOT or 1.1.0-incubating-SNAPSHOT archetypes (both tested)
2. mvn clean package
3. cd console && mvn -P embedded

At this point:

1. go to http://localhost:9082
2. select "Generic H2 (Server)"
3. set JDBC URL to "jdbc:h2:tcp://localhost:9092/testdb"
4. set username 'sa' and password 'sa'
5. connect
6. send SQL statement 'ALTER TABLE TEST ADD COLUMN newcol VARCHAR(255)'

Then:

1. log in http://localhost:9080/syncope-console/
2, go to resources -> resource-testdb -> mapping

The column "NEWCOL" is there when adding a new mapping, hence I am not able to reproduce what you say above. Is this the kind of result you are looking for?

Actually, "NEWCOL" is the only column available (because the other 3 columns are mapped to special ConnId attributes) and this makes the console to show NEWCOL everywhere.

I am going to open an issue for this (probably related to SYNCOPE-207).



Hi Denis,
I've finally been able to reproduce your issue: just execute the last two steps (e.g. looking at console's resource mapping) right after start (mvn -P embedded), then follow the steps reported above, including the last 2.

I've also made some pure-ConnId tests and everything works fine, hence it's Syncope's not ConnId's.

I've created SYNCOPE-209 for this.

Regards.



-----Messaggio originale-----
Da: Francesco Chicchiriccò [ mailto:ilgrosso@apache.org]
Inviato: sabato 8 settembre 2012 20.41
A: syncope-user@incubator.apache.org
Oggetto: Re: Allow Connector update the database schema without restart


On 30/07/2012 09:41, Denis Signoretto wrote:


Hi Syncopers,
 
at the moment if an external resource schema changes (e.g. column added or renamed),
the DB connector, can't see the changes until a Syncope restart (I'm wrong?). 
 
As a future improvement what do you think about a "db schema update" functionality for DB connector?


Hi Denis,
sorry, I've completely overlooked this e-mail (it was archived in the wrong mail thread...): could you please describe with some more detail the feature you are looking for? I suspect this is more ConnId's than Syncope's...

Regards.


-- 

Francesco Chicchiriccò



ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member

http://people.apache.org/~ilgrosso/


Re: Allow Connector update the database schema without restart

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 10/09/2012 16:01, Francesco Chicchiriccò wrote:
> On 10/09/2012 09:38, Denis Signoretto wrote:
>> Hi Francesco,
>>  
>> probably yes it could be an issue related to ConnId Table Connector.
>>  
>> If you alter a table, for instance adding a column, and you try to
>> update schema mapping on a existing resource
>> the structure of the table it's not reread and the new column cannot
>> be associated until a JVM restart (this is the only solution I've found).
>
> Denis,
> I've run the following procedure:
>
> 1. generate a project from 1.0.2-incubating-SNAPSHOT or
> 1.1.0-incubating-SNAPSHOT archetypes (both tested)
> 2. mvn clean package
> 3. cd console && mvn -P embedded
>
> At this point:
>
> 1. go to http://localhost:9082
> 2. select "Generic H2 (Server)"
> 3. set JDBC URL to "jdbc:h2:tcp://localhost:9092/testdb"
> 4. set username 'sa' and password 'sa'
> 5. connect
> 6. send SQL statement 'ALTER TABLE TEST ADD COLUMN newcol VARCHAR(255)'
>
> Then:
>
> 1. log in http://localhost:9080/syncope-console/
> 2, go to resources -> resource-testdb -> mapping
>
> The column "NEWCOL" is there when adding a new mapping, hence I am not
> able to reproduce what you say above. Is this the kind of result you
> are looking for?
>
> Actually, "NEWCOL" is the only column available (because the other 3
> columns are mapped to special ConnId attributes) and this makes the
> console to show NEWCOL everywhere.
>
> I am going to open an issue for this (probably related to SYNCOPE-207).

Hi Denis,
I've finally been able to reproduce your issue: just execute the last
two steps (e.g. looking at console's resource mapping) right after start
(mvn -P embedded), then follow the steps reported above, including the
last 2.

I've also made some pure-ConnId tests and everything works fine, hence
it's Syncope's not ConnId's.

I've created SYNCOPE-209 for this.

Regards.

>>     -----Messaggio originale-----
>>     *Da:* Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
>>     *Inviato:* sabato 8 settembre 2012 20.41
>>     *A:* syncope-user@incubator.apache.org
>>     *Oggetto:* Re: Allow Connector update the database schema without
>>     restart
>>
>>     On 30/07/2012 09:41, Denis Signoretto wrote:
>>>     Hi Syncopers,
>>>      
>>>     at the moment if an external resource schema changes (e.g.
>>>     column added or renamed),
>>>     the DB connector, can't see the changes until a Syncope restart
>>>     (I'm wrong?).
>>>      
>>>     As a future improvement what do you think about a "db schema
>>>     update" functionality for DB connector?
>>
>>     Hi Denis,
>>     sorry, I've completely overlooked this e-mail (it was archived in
>>     the wrong mail thread...): could you please describe with some
>>     more detail the feature you are looking for? I suspect this is
>>     more ConnId's than Syncope's...
>>
>>     Regards.
>>
-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


Re: Allow Connector update the database schema without restart

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 10/09/2012 09:38, Denis Signoretto wrote:
> Hi Francesco,
>  
> probably yes it could be an issue related to ConnId Table Connector.
>  
> If you alter a table, for instance adding a column, and you try to
> update schema mapping on a existing resource
> the structure of the table it's not reread and the new column cannot
> be associated until a JVM restart (this is the only solution I've found).

Denis,
I've run the following procedure:

1. generate a project from 1.0.2-incubating-SNAPSHOT or
1.1.0-incubating-SNAPSHOT archetypes (both tested)
2. mvn clean package
3. cd console && mvn -P embedded

At this point:

1. go to http://localhost:9082
2. select "Generic H2 (Server)"
3. set JDBC URL to "jdbc:h2:tcp://localhost:9092/testdb"
4. set username 'sa' and password 'sa'
5. connect
6. send SQL statement 'ALTER TABLE TEST ADD COLUMN newcol VARCHAR(255)'

Then:

1. log in http://localhost:9080/syncope-console/
2, go to resources -> resource-testdb -> mapping

The column "NEWCOL" is there when adding a new mapping, hence I am not
able to reproduce what you say above. Is this the kind of result you are
looking for?

Actually, "NEWCOL" is the only column available (because the other 3
columns are mapped to special ConnId attributes) and this makes the
console to show NEWCOL everywhere.

I am going to open an issue for this (probably related to SYNCOPE-207).

Regards.

>     -----Messaggio originale-----
>     *Da:* Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
>     *Inviato:* sabato 8 settembre 2012 20.41
>     *A:* syncope-user@incubator.apache.org
>     *Oggetto:* Re: Allow Connector update the database schema without
>     restart
>
>     On 30/07/2012 09:41, Denis Signoretto wrote:
>>     Hi Syncopers,
>>      
>>     at the moment if an external resource schema changes (e.g. column
>>     added or renamed),
>>     the DB connector, can't see the changes until a Syncope restart
>>     (I'm wrong?).
>>      
>>     As a future improvement what do you think about a "db schema
>>     update" functionality for DB connector?
>
>     Hi Denis,
>     sorry, I've completely overlooked this e-mail (it was archived in
>     the wrong mail thread...): could you please describe with some
>     more detail the feature you are looking for? I suspect this is
>     more ConnId's than Syncope's...
>
>     Regards.
>
-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


R: Allow Connector update the database schema without restart

Posted by Denis Signoretto <de...@intesys.it>.
Hi Francesco,
 
probably yes it could be an issue related to ConnId Table Connector.
 
If you alter a table, for instance adding a column, and you try to update schema mapping on a existing resource
the structure of the table it's not reread and the new column cannot be associated until a JVM restart (this is the only solution I've found).
 
Best Regards,
Denis.

-----Messaggio originale-----
Da: Francesco Chicchiriccò [mailto:ilgrosso@apache.org]
Inviato: sabato 8 settembre 2012 20.41
A: syncope-user@incubator.apache.org
Oggetto: Re: Allow Connector update the database schema without restart


On 30/07/2012 09:41, Denis Signoretto wrote:


Hi Syncopers,
 
at the moment if an external resource schema changes (e.g. column added or renamed),
the DB connector, can't see the changes until a Syncope restart (I'm wrong?). 
 
As a future improvement what do you think about a "db schema update" functionality for DB connector?


Hi Denis,
sorry, I've completely overlooked this e-mail (it was archived in the wrong mail thread...): could you please describe with some more detail the feature you are looking for? I suspect this is more ConnId's than Syncope's...

Regards.

-- 

Francesco Chicchiriccò



ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member

http://people.apache.org/~ilgrosso/ 


Re: Allow Connector update the database schema without restart

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 30/07/2012 09:41, Denis Signoretto wrote:
> Hi Syncopers,
> at the moment if an external resource schema changes (e.g. column 
> added or renamed),
> the DB connector, can't see the changes until a Syncope restart (I'm 
> wrong?).
> As a future improvement what do you think about a "db schema update" 
> functionality for DB connector?

Hi Denis,
sorry, I've completely overlooked this e-mail (it was archived in the 
wrong mail thread...): could you please describe with some more detail 
the feature you are looking for? I suspect this is more ConnId's than 
Syncope's...

Regards.

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/