agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
[Pljava-dev] create oid and WARNING
3+ messages / 0 participants
[nested] [flat]

* [Pljava-dev] create oid and WARNING
@ 2005-07-22 02:41  
  0 siblings, 2 replies; 3+ messages in thread

From:  @ 2005-07-22 02:41 UTC (permalink / raw)

Hello,

I tried to use LargeObject with PL/Java.
When I create oid, I receive WARNING message.
Oid is OK.

- pljava-1.1.0
- psql (PostgreSQL) 7.4.7
- java version "1.4.2_04"
- Fedora Core 2

When I tried with psql 8.0.3, I don't receive WARNING.
Do you have some idea?


--- I tried. ---
import java.sql.SQLException;
import java.util.logging.Logger;

import org.postgresql.pljava.internal.LargeObject;

public class CreateOidTest {
    public static int createOid() {
        try {
            LargeObject obj = LargeObject.create(LargeObject.INV_WRITE);
            Logger.getAnonymousLogger().info("create OID");
        } catch (SQLException e) {
            e.printStackTrace();
        }
        
        return 1;
    }
}


--- result 

Jul 22 10:12:45 tsukuyomi postgres[12885]: [100021-1] WARNING:  relcache 
reference leak: relation "pg_largeobject" has refcnt 2 instead of 0
Jul 22 10:12:45 tsukuyomi postgres[12885]: [100022-1] WARNING:  relcache 
reference leak: relation "pg_largeobject_loid_pn_index" has refcnt 2 instead 
of 0

----

Regards,
Shunsuke Ikegami


>Shunsuke,
>The LargeObject support in PL/Java is experimental and in the current 
>version, the C-code will not be initialized (hence the error that you 
>get). The code is there though, and if you want to play around with it, 
>my guess is that the only thing you need to do in order to get it to 
>work is to add the line:
>
>    LargeObject_initialize(fcinfo);
>
>somewhere near the end of function Type_initialize in the file 
>pljava/type/Type.c, recompile and try again.
>
>Regards,
>Thomas Hallgren




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] create oid and WARNING
@ 2005-07-22 10:18  
  parent: 
  1 sibling, 0 replies; 3+ messages in thread

From:  @ 2005-07-22 10:18 UTC (permalink / raw)

Probably a PostgreSQL bug that has been fixed in later versions. Post a 
query to the pgsql-hackers at postgresql.org  and ask about the warnings. 
Perhaps they can give you more info.

Regards,
Thomas Hallgren

Shunsuke Ikegami wrote:

>Hello,
>
>I tried to use LargeObject with PL/Java.
>When I create oid, I receive WARNING message.
>Oid is OK.
>
>- pljava-1.1.0
>- psql (PostgreSQL) 7.4.7
>- java version "1.4.2_04"
>- Fedora Core 2
>
>When I tried with psql 8.0.3, I don't receive WARNING.
>Do you have some idea?
>
>
>--- I tried. ---
>import java.sql.SQLException;
>import java.util.logging.Logger;
>
>import org.postgresql.pljava.internal.LargeObject;
>
>public class CreateOidTest {
>    public static int createOid() {
>        try {
>            LargeObject obj = LargeObject.create(LargeObject.INV_WRITE);
>            Logger.getAnonymousLogger().info("create OID");
>        } catch (SQLException e) {
>            e.printStackTrace();
>        }
>        
>        return 1;
>    }
>}
>
>
>--- result 
>
>Jul 22 10:12:45 tsukuyomi postgres[12885]: [100021-1] WARNING:  relcache 
>reference leak: relation "pg_largeobject" has refcnt 2 instead of 0
>Jul 22 10:12:45 tsukuyomi postgres[12885]: [100022-1] WARNING:  relcache 
>reference leak: relation "pg_largeobject_loid_pn_index" has refcnt 2 instead 
>of 0
>
>----
>
>Regards,
>Shunsuke Ikegami
>
>
>  
>
>>Shunsuke,
>>The LargeObject support in PL/Java is experimental and in the current 
>>version, the C-code will not be initialized (hence the error that you 
>>get). The code is there though, and if you want to play around with it, 
>>my guess is that the only thing you need to do in order to get it to 
>>work is to add the line:
>>
>>   LargeObject_initialize(fcinfo);
>>
>>somewhere near the end of function Type_initialize in the file 
>>pljava/type/Type.c, recompile and try again.
>>
>>Regards,
>>Thomas Hallgren
>>    
>>
>_______________________________________________
>Pljava-dev mailing list
>Pljava-dev at gborg.postgresql.org
>http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>  
>






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* [Pljava-dev] create oid and WARNING
@ 2005-07-26 07:45  
  parent: 
  1 sibling, 0 replies; 3+ messages in thread

From:  @ 2005-07-26 07:45 UTC (permalink / raw)


Thomas.
Thank you.

I resolved WARNING message problem.
LargeObject needed close().
It was simple problem.


--- Solved
import java.sql.SQLException;
import java.util.logging.Logger;

import org.postgresql.pljava.internal.LargeObject;

public class CreateOidTest {
    public static int createOid() {
        try {
            LargeObject obj = LargeObject.create(LargeObject.INV_WRITE);
            Logger.getAnonymousLogger().info("create OID");
	    obj.close();  // needed
        } catch (SQLException e) {
            e.printStackTrace();
        }
        
        return 1;
    }
}
----



Thank you,
Shunsuke Ikegami



>Probably a PostgreSQL bug that has been fixed in later versions. Post a 
>query to the pgsql-hackers at postgresql.org  and ask about the warnings. 
>Perhaps they can give you more info.
>
>Regards,
>Thomas Hallgren
>
>Shunsuke Ikegami wrote:
>
>>Hello,
>>
>>I tried to use LargeObject with PL/Java.
>>When I create oid, I receive WARNING message.
>>Oid is OK.
>>
>>- pljava-1.1.0
>>- psql (PostgreSQL) 7.4.7
>>- java version "1.4.2_04"
>>- Fedora Core 2
>>
>>When I tried with psql 8.0.3, I don't receive WARNING.
>>Do you have some idea?
>>
>>
>>--- I tried. ---
>>import java.sql.SQLException;
>>import java.util.logging.Logger;
>>
>>import org.postgresql.pljava.internal.LargeObject;
>>
>>public class CreateOidTest {
>>    public static int createOid() {
>>        try {
>>            LargeObject obj = LargeObject.create(LargeObject.INV_WRITE);
>>            Logger.getAnonymousLogger().info("create OID");
>>        } catch (SQLException e) {
>>            e.printStackTrace();
>>        }
>>        
>>        return 1;
>>    }
>>}
>>
>>
>>--- result 
>>
>>Jul 22 10:12:45 tsukuyomi postgres[12885]: [100021-1] WARNING:  relcache 
>>reference leak: relation "pg_largeobject" has refcnt 2 instead of 0
>>Jul 22 10:12:45 tsukuyomi postgres[12885]: [100022-1] WARNING:  relcache 
>>reference leak: relation "pg_largeobject_loid_pn_index" has refcnt 2 
>>instead 
>>of 0
>>
>>----
>>
>>Regards,
>>Shunsuke Ikegami
>>
>>
>>  
>>
>>>Shunsuke,
>>>The LargeObject support in PL/Java is experimental and in the current 
>>>version, the C-code will not be initialized (hence the error that you 
>>>get). The code is there though, and if you want to play around with it, 
>>>my guess is that the only thing you need to do in order to get it to 
>>>work is to add the line:
>>>
>>>   LargeObject_initialize(fcinfo);
>>>
>>>somewhere near the end of function Type_initialize in the file 
>>>pljava/type/Type.c, recompile and try again.
>>>
>>>Regards,
>>>Thomas Hallgren


?/**  ???? shun at datasection.co.jp    */
?/**  ????????????           */
?/**  http://www.datasection.co.jp       */
  /**                                     */
  /**  ????????????           */
  /**  ?150-0044                         */
  /**  ?????????23-2             */
  /**  ??????3F                     */
  /**  TEL/FAX 03-5459-1050               */




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-07-26 07:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-22 02:41 [Pljava-dev] create oid and WARNING 
2005-07-22 10:18 ` 
2005-07-26 07:45 ` 

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox