Skip to main content

Questions tagged [hibernate]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
3k views

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 ...
Eager's user avatar
  • 111
6 votes
5 answers
10k views

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 ...
D-K's user avatar
  • 533
1 vote
1 answer
1k views

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 ...
Luky's user avatar
  • 121
0 votes
1 answer
1k views

IF @@trancount > 0 COMMIT TRANSACTION Causing blocking

We have a Java application / hibernate connecting to SQL Server. It looks like implicit transaction is on by default. I am not sure if this is from hibernate or JDBC Driver . However this implicit ...
sebeid's user avatar
  • 1,401
3 votes
0 answers
1k views

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 ...
Maurice's user avatar
  • 147
0 votes
1 answer
1k views

In general should we avoid using ORM's with Redshift

My team is considering utilizing Hibernate/Envers for a granular point in time rollback solution for Redshift data. I have heard that using an ORM with Redshift is not a good idea. Are there ...
mikelus's user avatar
  • 333
0 votes
1 answer
141 views

Prevent failure in conditional insert in mysql database

The infrastructure of our system looks like this. An AWS lambda function receives requests such as (accountId, .....). It creates an entry in the MySQL database using a newly generated UUID as caseId....
Swagatika's user avatar
  • 101
0 votes
1 answer
565 views

Automatically purge dropped tables in Oracle

I am using an Oracle 18c database in a build system. One of my builds is for a JPA/Hibernate project, which is configured as "create-drop". This means it will create all tables during startup and ...
Tobias Liefke's user avatar
1 vote
1 answer
3k views

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 ...
franklinexpress's user avatar
1 vote
1 answer
169 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 ...
user59290's user avatar
0 votes
0 answers
21 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 ...
sofs1's user avatar
  • 101
3 votes
1 answer
7k 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 ...
Balázs E. Pataki's user avatar
-1 votes
1 answer
551 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. ...
محسن عباسی's user avatar
1 vote
1 answer
98 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, ...
Feillen's user avatar
  • 191
3 votes
1 answer
9k 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 ...
chrylis -cautiouslyoptimistic-'s user avatar
1 vote
0 answers
138 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 ...
xbmono's user avatar
  • 111
0 votes
1 answer
591 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 ...
Avan CaiJun's user avatar
1 vote
1 answer
1k 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 (...
a3.14_Infinity's user avatar
1 vote
0 answers
315 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 ...
Spenhouet's user avatar
  • 111
0 votes
3 answers
5k 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 ...
user avatar
4 votes
1 answer
5k 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 ...
user2819101's user avatar
0 votes
1 answer
92 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 ...
yeaaaahhhh..hamf hamf's user avatar
1 vote
0 answers
300 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 ...
yeaaaahhhh..hamf hamf's user avatar
0 votes
1 answer
9k 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 ...
techPackets's user avatar
0 votes
1 answer
103 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. ...
SomeGuy's user avatar
  • 2,053
0 votes
2 answers
3k 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 ...
Codefool's user avatar
1 vote
2 answers
3k 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 = ? ...
qxlab's user avatar
  • 113
15 votes
3 answers
24k 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 ...
P.Péter's user avatar
  • 901
1 vote
0 answers
1k 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 ...
kha150's user avatar
  • 11
1 vote
1 answer
2k 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 `...
Urbanleg's user avatar
  • 365
5 votes
1 answer
1k 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 ...
8bitartist's user avatar
1 vote
0 answers
2k 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 \ ...
Urbanleg's user avatar
  • 365
1 vote
1 answer
738 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' ...
Jaya Ananthram's user avatar
0 votes
1 answer
49 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.
MullaBihari's user avatar
14 votes
2 answers
22k 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 ...
John P's user avatar
  • 411
1 vote
1 answer
322 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. ...
Daniel Bower's user avatar
2 votes
1 answer
711 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, ...
mangusbrother's user avatar