You should not do that. The specs say that the java:comp/env environment is
read-only. If it isn't, it's a bug in your container.

JB.

Dan Hinojosa wrote:

> I have an environment java.lang.Integer value that tracks the last ID
> (ID being a unique key in my db).  After I create an entity I would like
> to increment that number one higher so that the next time an entity
> needs to be created it can use the next number.  One of my solutions was
> via an EJB Client
>
> Context ctx = new InitialContext();
> Object obj = ctx.lookup("java:comp/env/NextID");
> int id = ((Integer)obj).getValue();
>
> //set the id
>
> /* These next lines of code did not work
> ctx.rebind("java:comp/env/NextID",new Integer(++id));
> ctx.bind("java:comp/env/NextID",new Integer(++id)); */
>
> Can anyone help me with this problem?
> --
>
> Dan Hinojosa
> Java & Lotus Notes Consultant
> Java Certified Programmer
>
> P.O. Box 4675
> Albuquerque, NM 87196-4675
> Telephone: (505) 262-0911
> Email: [EMAIL PROTECTED]
> WWW: http://www.digitalpriest.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
Jean-Baptiste Nizet
[EMAIL PROTECTED]

R&D Engineer, S1 Belgium
Kleine Kloosterstraat, 23
B-1932 Sint-Stevens Woluwe
+32 2 200 45 42

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to