You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Robin Batra <ro...@gmail.com> on 2009/12/31 11:46:25 UTC

Branching and workspace creation

Hi,

I was trying to create a new workspace from my code. When the workspace name
starts with an alphabet everything works fine but if the workspace name
starts with a digit (say 2,3 etc) i get a NoSuchWorkspaceException. Any
comments are welcome....

-- 
Regards

Robin Batra

Re: Branching and workspace creation

Posted by Thomas Müller <th...@day.com>.
Hi,

> But my only concern is it should not effect
> the existing workspaces that were created before making the change to
> SchemaObjectPrefix

I'm afraid that adding double quotes around the table names in db2.dll
is not enough, because the queries are hardcoded in the persistence
manager.

What you could do is manually rename the existing tables in the database:

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000980.htm

Regards,
Thomas

Re: Branching and workspace creation

Posted by Robin Batra <ro...@gmail.com>.
Thanks a lot Thomas, it WORKED. But my only concern is it should not effect
the existing workspaces that were created before making the change to
SchemaObjectPrefix

On Mon, Jan 4, 2010 at 5:50 PM, Thomas Müller <th...@day.com>wrote:

> Hi,
>
> > creation of tables whose name starts with numbers
>
> Yes, quoted names are supported (by all databases): create table "1"(id
> int);
>
> However Jackrabbit doesn't use quoted names. This will not work, even
> in DB2: create table 1(id int);
>
> What about adding a letter prefix: <param name="schemaObjectPrefix"
> value="W${wsp.name}_"/>*
>
> Regards,
> Thomas
>
>
>
> On Mon, Jan 4, 2010 at 10:56 AM, Robin Batra <ro...@gmail.com>
> wrote:
> > I tried creating the table in DB2 using its control center and it allows
> the
> > creation of tables whose name starts with numbers. The same is allowed in
> > MySql as well.
> >
> > regarding the schema Object Prefix,
> >
> > *<param name="schemaObjectPrefix" value="${wsp.name}_"/>*
> >
> > this is the entry in repository.xml
> >
> > On Sun, Jan 3, 2010 at 10:06 PM, Alexander Klimetschek <aklimets@day.com
> >wrote:
> >
> >> On Thu, Dec 31, 2009 at 19:22, Robin Batra <ro...@gmail.com>
> wrote:
> >> > I am working on Windows XP and xp does support creation of folders
> >> starting
> >> > with numbers. Moreover when i try to create the workspace through my
> code
> >> > the folder is created but when the persistent manager tries to create
> the
> >> > database table corresponding to it an exception is thrown on the
> server.
> >> The
> >> > error code returned by DB2 corresponds to "Invalid numeric literal" (i
> am
> >> > using DB2 as the back-end). I think this is the problem of DDL used by
> >> the
> >> > persistent manager but i am not at all sure.
> >>
> >> Or maybe DB2 doesn't allow numbers in table / schema names? What are
> >> the schemaObjectPrefix'es you have in your repository/workspace.xml?
> >>
> >> Regards,
> >> Alex
> >>
> >> --
> >> Alexander Klimetschek
> >> alexander.klimetschek@day.com
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Robin Batra
> >
>



-- 
Regards

Robin Batra

Re: Branching and workspace creation

Posted by Thomas Müller <th...@day.com>.
Hi,

> creation of tables whose name starts with numbers

Yes, quoted names are supported (by all databases): create table "1"(id int);

However Jackrabbit doesn't use quoted names. This will not work, even
in DB2: create table 1(id int);

What about adding a letter prefix: <param name="schemaObjectPrefix"
value="W${wsp.name}_"/>*

Regards,
Thomas



On Mon, Jan 4, 2010 at 10:56 AM, Robin Batra <ro...@gmail.com> wrote:
> I tried creating the table in DB2 using its control center and it allows the
> creation of tables whose name starts with numbers. The same is allowed in
> MySql as well.
>
> regarding the schema Object Prefix,
>
> *<param name="schemaObjectPrefix" value="${wsp.name}_"/>*
>
> this is the entry in repository.xml
>
> On Sun, Jan 3, 2010 at 10:06 PM, Alexander Klimetschek <ak...@day.com>wrote:
>
>> On Thu, Dec 31, 2009 at 19:22, Robin Batra <ro...@gmail.com> wrote:
>> > I am working on Windows XP and xp does support creation of folders
>> starting
>> > with numbers. Moreover when i try to create the workspace through my code
>> > the folder is created but when the persistent manager tries to create the
>> > database table corresponding to it an exception is thrown on the server.
>> The
>> > error code returned by DB2 corresponds to "Invalid numeric literal" (i am
>> > using DB2 as the back-end). I think this is the problem of DDL used by
>> the
>> > persistent manager but i am not at all sure.
>>
>> Or maybe DB2 doesn't allow numbers in table / schema names? What are
>> the schemaObjectPrefix'es you have in your repository/workspace.xml?
>>
>> Regards,
>> Alex
>>
>> --
>> Alexander Klimetschek
>> alexander.klimetschek@day.com
>>
>
>
>
> --
> Regards
>
> Robin Batra
>

Re: Branching and workspace creation

Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Jan 4, 2010 at 10:56, Robin Batra <ro...@gmail.com> wrote:
> I tried creating the table in DB2 using its control center and it allows the
> creation of tables whose name starts with numbers. The same is allowed in
> MySql as well.
>
> regarding the schema Object Prefix,
>
> *<param name="schemaObjectPrefix" value="${wsp.name}_"/>*
>
> this is the entry in repository.xml

Then I have no more guesses ;-) I think to further debug this issue,
you could try to post the actual sql statement that gets executed
(maybe db2 has a log for that) + the error message and post it here.
Maybe someone immediately spots the error then.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Branching and workspace creation

Posted by Robin Batra <ro...@gmail.com>.
I tried creating the table in DB2 using its control center and it allows the
creation of tables whose name starts with numbers. The same is allowed in
MySql as well.

regarding the schema Object Prefix,

*<param name="schemaObjectPrefix" value="${wsp.name}_"/>*

this is the entry in repository.xml

On Sun, Jan 3, 2010 at 10:06 PM, Alexander Klimetschek <ak...@day.com>wrote:

> On Thu, Dec 31, 2009 at 19:22, Robin Batra <ro...@gmail.com> wrote:
> > I am working on Windows XP and xp does support creation of folders
> starting
> > with numbers. Moreover when i try to create the workspace through my code
> > the folder is created but when the persistent manager tries to create the
> > database table corresponding to it an exception is thrown on the server.
> The
> > error code returned by DB2 corresponds to "Invalid numeric literal" (i am
> > using DB2 as the back-end). I think this is the problem of DDL used by
> the
> > persistent manager but i am not at all sure.
>
> Or maybe DB2 doesn't allow numbers in table / schema names? What are
> the schemaObjectPrefix'es you have in your repository/workspace.xml?
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
Regards

Robin Batra

Re: Branching and workspace creation

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Dec 31, 2009 at 19:22, Robin Batra <ro...@gmail.com> wrote:
> I am working on Windows XP and xp does support creation of folders starting
> with numbers. Moreover when i try to create the workspace through my code
> the folder is created but when the persistent manager tries to create the
> database table corresponding to it an exception is thrown on the server. The
> error code returned by DB2 corresponds to "Invalid numeric literal" (i am
> using DB2 as the back-end). I think this is the problem of DDL used by the
> persistent manager but i am not at all sure.

Or maybe DB2 doesn't allow numbers in table / schema names? What are
the schemaObjectPrefix'es you have in your repository/workspace.xml?

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Branching and workspace creation

Posted by Robin Batra <ro...@gmail.com>.
I am working on Windows XP and xp does support creation of folders starting
with numbers. Moreover when i try to create the workspace through my code
the folder is created but when the persistent manager tries to create the
database table corresponding to it an exception is thrown on the server. The
error code returned by DB2 corresponds to "Invalid numeric literal" (i am
using DB2 as the back-end). I think this is the problem of DDL used by the
persistent manager but i am not at all sure.

On Thu, Dec 31, 2009 at 9:03 PM, Alexander Klimetschek <ak...@day.com>wrote:

> On Thu, Dec 31, 2009 at 11:46, Robin Batra <ro...@gmail.com> wrote:
> > I was trying to create a new workspace from my code. When the workspace
> name
> > starts with an alphabet everything works fine but if the workspace name
> > starts with a digit (say 2,3 etc) i get a NoSuchWorkspaceException. Any
> > comments are welcome....
>
> What does the rest of the stacktrace say? I guess your operating
> system doesn't support file/folder names starting with numbers, and
> since there will be a folder named after the workspace under
> "workspaces/" in your repository home directory (in the default
> configuration), this won't work.
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>



-- 
Regards

Robin Batra

Re: Branching and workspace creation

Posted by Alexander Klimetschek <ak...@day.com>.
On Thu, Dec 31, 2009 at 11:46, Robin Batra <ro...@gmail.com> wrote:
> I was trying to create a new workspace from my code. When the workspace name
> starts with an alphabet everything works fine but if the workspace name
> starts with a digit (say 2,3 etc) i get a NoSuchWorkspaceException. Any
> comments are welcome....

What does the rest of the stacktrace say? I guess your operating
system doesn't support file/folder names starting with numbers, and
since there will be a folder named after the workspace under
"workspaces/" in your repository home directory (in the default
configuration), this won't work.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com