Questions tagged [hibernate]

39 questions
15
votes
3 answers

PostgreSQL query very slow when subquery added

I have a relatively simple query on a table with 1.5M rows: SELECT mtid FROM publication WHERE mtid IN (9762715) OR last_modifier=21321 LIMIT 5000; EXPLAIN ANALYZE output: Limit (cost=8.84..12.86 rows=1 width=8) (actual time=0.985..0.986 rows=1…
P.Péter
  • 911
  • 1
  • 9
  • 20
14
votes
2 answers

Get TEXT value of a CLOB OID in Postgresql

I have a database table that looks like: create table answers( id int not null, question_id int not null, answer text null ) This table was originally build by Hibernate using the @Lob attribute for the "answer" column. I did not realize…
John P
  • 411
  • 1
  • 3
  • 7
6
votes
5 answers

Is OPTION (RECOMPILE) used in production environments?

Is OPTION (RECOMPILE) used in production? This option seems to get a lot of bad press. Is it deserved? I have a DBA who, so far, is not a fan of the idea of OPTION (RECOMPILE) within the meat of Report ETL ssis agent queries. These queries are…
D-K
  • 543
  • 1
  • 5
  • 17
5
votes
1 answer

Why does this fast postgres query show up in the slow query log?

On investigating an entry in our Postgres log, I noticed a large discrepancy between the reported duration and the speed of the query. 2015-07-28 17:27:26 UTC [dms_segment_3] LOG: duration: 2924.763 ms bind : SELECT prospect.id AS…
8bitartist
  • 153
  • 4
4
votes
1 answer

MySQL process stuck on “cleaning up”, locking table forever

It was suggested I post here as opposed to StackOverflow. I'm new to debugging mysql/innodb issues so here is the best I have: I'm trying to run an integration test so these results are near identical each time, the test is consistently hanging at…
user2819101
  • 41
  • 1
  • 2
3
votes
0 answers

Can a MySql stored procedure return multiple resultsets each containing different columns?

I have made a stored procedure that returns multiple resultsets from multiple tables. Therefore each resultset is made out of different columns. These resultsets are retrieved by an ProcedureOutputs object from the Hibernate framework. The first…
Maurice
  • 147
  • 9
3
votes
1 answer

What kind of deadlock the deadlock_timeout config parameter detects in Postgresql?

My overall goal is to get a 40P01/ERRCODE_T_R_DEADLOCK_DETECTED from postgres when an deadlock is detected. (To be more precise, I would like to get a LockAcquisitionException in Hibernate, which is the exception the…
3
votes
1 answer

Can I set PostgreSQL "stringtype=unspecified" behavior as default?

I am trying to get Hibernate to save Java enum fields as enum columns in PostgreSQL 9.6. If I map the fields as @Enumerated(STRING), Hibernate naively uses the enum name as the column contents. This works splendidly for reads (it just gets the…
2
votes
1 answer

at least one member of a list within another list when querying over a join

Assume the following layout in a MySQL database Activity (id,etc) [id is primary key] AcitivityMapper (activityID, targetYearID) [composite key] Years (targetYearID, targetYearName) [id primary key, name is unique] I would like to, given a list of…
1
vote
1 answer

Queries that ran, and the number of times they ran

I want to profile a running web application in dev on a mysql 5.5 database. The web application uses hibernate and I am able to see that a rather large number of queries are run against the database. I'm able to see long running queries with…
Daniel Bower
  • 113
  • 4
1
vote
0 answers

SQLGrammarException: could not extract ResultSet; Snapshot isolation transaction failed in database

I am trying to reproduce and fix the recently caught exception: [jdbc.spi.SqlExceptionHelper] ? Snapshot isolation transaction failed in database 'config_db' because the object accessed by the statement has been modified by a DDL statement in…
Eager
  • 111
  • 1
  • 3
1
vote
1 answer

how to call lo_unlink(lo) in batches

In Postgres 9.5 I am tying to reproduce the postgres tool vacuumlo to get rid of unreferenced large object to free disk space. References are stored in text type columns by hibernate so using the tool as is is not an option. Looking at vacuumlo…
1
vote
1 answer

AWS RDS mysql deadlock

Everything in our production environment was working well. Yesterday, suddenly out of no where we were getting "lock wait" on any transaction related to a specific row. Same transaction on another row worked when the lock was removed, but editing…
franklinexpress
  • 111
  • 1
  • 2
1
vote
1 answer

@OneToMany mapping but only one is needed

I have to create a new table to store version numbers of Terms&Conditions user have accepted and the time stamp of when they click accept. (This table only contains info related to user. Info about the T&C version itself is stored in another…
user59290
  • 11
  • 2
1
vote
1 answer

And Java Justice For All

Recently, I thought I was gettint into a Oracle Database Administration and Development project, with a heavy load of plsql programming in the form of stored procedures and such. I was struck when, the other day, I was told I shouldn't rely so much…
Feillen
  • 191
  • 2
  • 4
  • 15
1
2 3