Optix texture re-mapping?

Hi all,
I intend to re-map a optix TextureSampler to another OpenGl texture. but I do not know how to do it. I would like to know how can I do that.
I init a optix TextureSampler with code like this:
rtWorldSpaceTexture = rtContext->createTextureSamplerFromGLImage(currentGbuffer.getTexture(0), RT_TARGET_GL_TEXTURE_2D);
I intend to use another OpenGl texture as the resource of “rtWorldSpaceTexture” but I failed.
I tried the methods like the following:
1.rtWorldSpaceTexture = rtContext->createTextureSamplerFromGLImage(anotherTex, RT_TARGET_GL_TEXTURE_2D);
2.rtWorldSpaceTexture->unregisterGLTexture();
glBindTexture(GL_TEXTURE_2D,anotherTex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F_ARB, traceWidth, traceHeight, 0, GL_RGBA, GL_FLOAT, NULL);
rtWorldSpaceTexture->registerGLTexture();

But it seems the mapping to a new texture sampler is wrong.
Is there anyone who is familiar with this issue?

My situation is that: I have a range of Gbuffer texture images. Instead of allocating a range of optix handles, I only want to create one handle and remap the correct Gbuffer texture to this handle.
How can I achieve that?

Currently, I have to destroy this optix texture sampler, and allocate a new one to register a new texture, which takes about 0.2 seconds. That is time consuming. Is there some smart way to map the OpenGl texture?

What error messages do you get from your method (1) and (2) above?

Thanks for your reply.
It is not a error, but the problems is that the mapping does not change.

For example, I have a optix texture handle and a range of Opengl textures (id from 1 to 10). I initialize texture handle so that it maps to OPENGL texture Id 1. Next frame I want this handle to map to texture Id 2 so that Optix can get access to another texture. If I use the method (1) and (2) above, the mapping id of that handle is still 1.

This is odd. Both of these methods should work. Could you by chance send the relevent code, including creation and modification of the gl textures as well as the creation and modification of the optix texture sampler to optix-help@nvidia.com.

Thanks