RE: [JBoss-user] primary key problem

2001-05-16 Thread Frank Villarreal

Check out this discussion thread on "the Server Side":
http://theserverside.com/patterns/thread.jsp?thread_id=4228

it contains a boat-load of information/ideas on how to create unique id's
for EJBs. Hope it helps!

- Frank


-Original Message-
From: Cumps Jef [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 1:37 PM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] primary key problem


Hi all, 

i have a problem and some solutions, but i don't know which one's the best: 

I have some entity beans working with MS SQL Server. When i undeploy my
application the tables are not destoyed and i don't want them to. The
problem is that i want to work with an int as Primary Key for those entity
beans. That int should be auto-increasing if you get what i mean. Every new
row in the database should get the next number. 

I cannot work with a static int in my bean because when i re-deploy it, it
will restart counting from 0 and that row would already exist. 

I could make a database acces in every create method to check which the last
PK in the database was, but i've got the feeling there's a better solution. 

Is there a standard way to work here, or not. What would be the best
solution ?? Any possibility to make SQL Server do the job itself ?? 

any help, tips or examples would be really appreciated. 

thanx in advance, 

jef
>

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] primary key problem

2001-03-21 Thread danch

You're using JBoss 2.0, right? If so this is a known weakness of that 
version.

Andy Evans wrote:

> Hi
> 
> CMP beans work fine EXCEPT a primary key is not
> created in the database table just a normal column.
> This happens both with mySQL and InstantDB.
> 
> Has anybody else noticed this.
> 
> Andy Evans
> 
> 
> 
> 
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
> 
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user



___
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user