db info in server problem

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

db info in server problem

Postby nromeou » Fri Mar 30, 2012 4:32 pm

Hi,
im working with servoy 6 over DBFs (using smart client) and i have a little problem.
We had a table with 3 fields marked as 'row_ident', at some poin we realized that was a mistake and that only 2 of those fields made the uniqueness of the record, so on the developer we modified the dbi without any trouble.
Theres a form in my solution where i do a loadRecord() passing on a dataset composed by those 2 fields and when executing it in developer i have no problem at all, the records are loaded correctly, but when running it from the server i get an error saying that the size of the pk im passing (2) doesnt match the one of the table (3), so i guess that although i modified the dbi and imported the solution again on the server the information about the row_idents was never updated.

I know there are no dbis on the server side, so where is he keeping this information? how can i tell him that now the identifiers of that table are 2 and not 3 like it used to be??

thanks in advance
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: db info in server problem

Postby Andrei Costescu » Mon Apr 02, 2012 10:15 am

I guess you just get a "The server version of the column X has Y constraint while in the import (...)" warning.
Try creating a pre-import hook, and in it use the maintenance plugin (getServer(...).getTable(...).getColumn(...).setFlag(...) with ROWID_COLUMN) to reset the rowID flag of that column.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: db info in server problem

Postby nromeou » Mon Apr 09, 2012 5:30 pm

im not being able to call the setFlag method on the column, it doesnt show up as an available method.
how is this supposed to work? could it be that the method has been deprecated or something?
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: db info in server problem

Postby Andrei Costescu » Mon Apr 09, 2012 6:11 pm

You are probably on Servoy 5.
The method I suggested was added in 6.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: db info in server problem

Postby nromeou » Mon Apr 09, 2012 6:41 pm

im on Version: 6.0.0 - build 1217
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: db info in server problem

Postby nromeou » Mon Apr 09, 2012 7:01 pm

the wiki doesnt show that method for servoy 6

http://wiki.servoy.com/display/public/DOCS/JSColumn
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: db info in server problem

Postby Andrei Costescu » Tue Apr 10, 2012 12:46 pm

You are right. It was added in 6.0.1.

Sample:
Code: Select all
   var pk = table.createNewColumn("id", JSColumn.MEDIA, 16); // can also use (JSColumn.TEXT, 36) for UUIDs
   pk.setFlag(JSColumn.PK_COLUMN, true);
   pk.setFlag(JSColumn.UUID_COLUMN, true)
   pk.sequenceType = JSColumn.UUID_GENERATOR

The only other option I can think of (except for modifying repository tables via query directly) is to drop the table in pre-import hook and let import recreate it.
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: db info in server problem

Postby nromeou » Tue Apr 10, 2012 3:11 pm

well i ended up modifying the repository table, thanks for the help
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 5 guests

cron