Questions tagged [hibernate]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
8
votes
3answers
7k views

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 ...
8
votes
1answer
6k views

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 ...
5
votes
1answer
754 views

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 ...
3
votes
1answer
1k views

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 ...
3
votes
1answer
2k views

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 ...
2
votes
1answer
506 views

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, ...
2
votes
1answer
920 views

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 ...
1
vote
1answer
1k views

Mysql triggers for auditing

We have a requirement to fulfill - we need an auditing table for all of our entities. We wonder if creating the following triggers will be a good practice: CREATE DEFINER=`root`@`localhost` TRIGGER `...
1
vote
1answer
558 views

How to sort strings with special characters in Hibernate?

For example, if the Order in criteria is ascending and if we have two names like follows: _zname_9 1_aname_ I get an output (from hibernate result) like: _zname_9 1_aname_ But the expected output (...
1
vote
1answer
538 views

SQL Server 2012 CPU usage spikes to 100%

I am using SQL Server 2014 in AWS and the AWS image configuration is 4 cores and 16GB RAM(m3.xlarge). I am running the following simple query, SELECT * FROM user_table WHERE user_id = '10' ...
1
vote
1answer
31 views

@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 ...
1
vote
1answer
89 views

And Java Justice For All [closed]

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, ...
1
vote
0answers
65 views

Error for some tables while inserting when default database is not 'master' in Sybase

I am not sure whether I should post this here or in Java's related site but because the error is a bit technical and Java developers may not know about it I thought this is the right place. So the ...
1
vote
0answers
179 views

Is it possible to use Hibernate for OLAP-server?

I have a PostgreSQL database with Java Hibernate. I need a XMLA datasource for a pivot grid client component. Is it possible to use Hibernate for a OLAP-server? Which OLAP-server does support ...
1
vote
0answers
214 views

Database for buses timetables

I have to design a database for buses timetables. Entities: Bus (idBus*) Stop (idStop*,stopDescription) Line (idLine*,lineDescription) Position (lat,lon) Some constraints are ...
1
vote
2answers
2k views

Oracle UPDATE statements lock race condition

Say I have a table MY_TABLE without optimistic lock column. I have the following update statement that will be executed with org.hibernate.SQLQuery: UPDATE MY_TABLE SET NAME = ? WHERE SOME_NUMBER = ? ...
1
vote
0answers
884 views

Generate tables from entities with hibernate

I'm using postgresql with a spring/hibernate to create a multi-tenant application where every company will have its own seperate schema and tables in the database. So when the super administrator ...
1
vote
1answer
227 views

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. ...
0
votes
1answer
162 views

Conditional Database View of Postgresql

I have a situation here. Currently I have two polling tables (poll_one and poll_two) which will poll data from outside data-source. This two tables will keep interchange between each other. one ...
0
votes
3answers
3k views

replicate data from one db to another db server using automated process

I have an scenario, I have two DB server running on two different machines. I have to build an automated process by which the data will replicate from one DB to another DB server on every insertion ...
0
votes
1answer
54 views

Hibernate modelling a N:N Relationship

Lets say that we have two entities Entities: Bus (idBus*) Stop (idStop*,stopDescription) Where a Bus passes from many Stops and vice versa, therefore the cardinality is N:N. My ...
0
votes
1answer
4k views

MySQLSyntaxErrorException: You have an error in your SQL syntax;

This is the issue I am trying to fix since hours, almost a day. I am unable to get an understanding of what might be wrong. I have a SQL table notification I am trying to persist a java object via ...
0
votes
2answers
2k views

Updating rows in tables concurrently using Multithreading in Java

I have an excel file with 50000 rows and I'm updating a MySQL table using hibernate by uploading that excel file from a Java Program. It is taking a huge time to update all the rows. Can it be ...
0
votes
0answers
14 views

Design a show with competitions of different types

I am currently working on designing a schema for a scheduling system involving a show and different types of competition. The requirements are: A show can contain n competitions of different types (...
0
votes
0answers
12 views

Does using new ReferenceType in a hibernate query affect performance?

I have follow code in my java DAO class. Query query = session.createQuery("select new Question(q.qid, q.qtype) from Question q where q.qlang=:lang "); Does using new object type in a hibernate ...
0
votes
1answer
53 views

Consultants using old version of Hibernate ORM for new application - should I be concerned?

My company currently has consultants developing a Java-based application. They are using Hibernate ORM 3.5 (released 5 1/2 years ago in 2010) in this application. The back-end is SQL Server 2012. ...
0
votes
0answers
1k views

Deadlocks due to foreign keys (MySQL)

We are in the process of creating a web application using mysql as a data source. We are using spring with hibernate as an ORM framework. We have hundreds of entities with relations (manyToMany \ ...
0
votes
1answer
41 views

Meaning of JOINs in sql

I was trying to interpret the relationship between JOINs like LEFT-OUTER JOIN, RIGHT-OUTER JOIN, etc with relationships like Many-To-Many, One-To-Many etc in Hibernate or database language.
-1
votes
1answer
314 views

How to handle many connections to a large MySQL database

I have multiple java hibernate apps connecting to 1 single mysql DB. Sometimes some of the apps hangs on DB select query. I think it is because of many connections the apps are to DB and remains open. ...