Re: Cannot insert to 'path' field using EclipseLink

Поиск
Список
Период
Сортировка
От Sehrope Sarkuni
Тема Re: Cannot insert to 'path' field using EclipseLink
Дата
Msg-id CAH7T-aqgSFYZNAJOHY7Z=_PDXYG1CVPed6LZ1b45rpcZURNo=A@mail.gmail.com
обсуждение исходный текст
Ответ на Cannot insert to 'path' field using EclipseLink  (Daryl Foster <daryl.foster@oncenter.com>)
Список pgsql-jdbc
Daryl-

I'm not too familiar with EclipseLink but looks like the problem is
there and not with the PG JDBC driver.

If you use the JDBC driver directly and call setObject(...) to bind
the PGpath parameter, it works fine for both null and not-null values
(tested with the latest 9.3 JDBC driver against a 9.3 database):

  Table:
    CREATE TABLE path_sample (name text, item_path path);

  Java:
    Connection conn = ...
    String sql = "INSERT INTO path_sample (name, item_path) VALUES (?, ?)";
    PreparedStatement stmt = conn.prepareStatement(sql);
    // Insert a not null point:
    stmt.setString(1, "foobar");
    stmt.setObject(2, new PGpath(new PGpoint[] {new PGpoint(0, 0), new
PGpoint(1, 1)}, false));
    stmt.execute();
    // Insert a null point:
    stmt.setString(1, "null point");
    stmt.setObject(2, null);
    stmt.execute();

My guess is that EclipseLink isn't calling setObject(...). I suggest
you enable more debug logs for EclipseLink to see exactly what it's
doing and how it's binding the statement parameters. Your converter is
probably not being used properly.

Regards,
Sehrope Sarkuni
Founder & CEO | JackDB, Inc. | http://www.jackdb.com/


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Daryl Foster
Дата:
Сообщение: Cannot insert to 'path' field using EclipseLink
Следующее
От: Daryl Foster
Дата:
Сообщение: Re: Cannot insert to 'path' field using EclipseLink