What layer should resolve pre-existing Hibernate entities?

Imagine an application that consumes an external data stream and creates objects of this type:

@Entity public class Event {    @OneToOne(cascade = CascadeType.ALL)   private EventInfo info;    @OneToOne(cascade = CascadeType.ALL)   private EventSource source;    ...  } 

Later in the DAO:

session.save(event); 

In the data stream, every Event has a fully self-contained JSON representation of both the EventInfo and the EventSource.

This has been working fine, but now need to refactor this code ans ensure that EventSource entities are re-used, i.e. change to:

  @ManyToOne(cascade = ???)   private EventSource source; 

Now the question is this. Given that the external data-stream always contains a full representation, it is necessary to look-up EventSource in the database and re-set the value in the Event object prior to saving the Event entity.

What layer of the receiving application should be responsible for the look-up?

When I hibernate, my computer no longer recognizes speakers, what should I do?

I recently upgraded to Ubuntu 19.04 and have been experiencing sound issues. Everytime I hibernate my computer, it no longer recognizes my internal speakers. When I restart my computer, it recognizes them. So I have to always shutdown computer after each session. How can I fix this.

only headphones show

Only headphones show in settings

Speakers show unplugged in pavucontrol

Again, this is only happening after I hibernate, everything is fine after I restart.

concurrencia en hibernate

09:02:20,355 INFO  [stdout] (http--127.0.0.1-8080-4) Hibernate Configuration loaded 09:02:20,360 ERROR [stderr] (http--127.0.0.1-8080-7) org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.event.service.spi.EventListenerRegistry] 09:02:20,395 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:126) 09:02:20,401 INFO  [stdout] (http--127.0.0.1-8080-15) Hibernate Configuration loaded 09:02:20,409 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.action.internal.EntityAction.listenerGroup(EntityAction.java:194) 09:02:20,417 INFO  [stdout] (http--127.0.0.1-8080-5) Hibernate Configuration loaded 09:02:20,444 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.action.internal.EntityInsertAction.hasPostCommitEventListeners(EntityInsertAction.java:206) 09:02:20,446 INFO  [stdout] (http--127.0.0.1-8080-9) Hibernate Configuration loaded 09:02:20,459 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.action.internal.EntityAction.needsAfterTransactionCompletion(EntityAction.java:88) 09:02:20,461 INFO  [stdout] (http--127.0.0.1-8080-6) Hibernate Configuration loaded 09:02:20,473 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.action.internal.EntityAction.getAfterTransactionCompletionProcess(EntityAction.java:80) 09:02:20,478 INFO  [stdout] (http--127.0.0.1-8080-8) Hibernate Configuration loaded 09:02:20,487 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.engine.spi.ActionQueue.registerCleanupActions(ActionQueue.java:378) 09:02:20,494 INFO  [stdout] (http--127.0.0.1-8080-13) Error al cerrar 09:02:20,517 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:365) 09:02:20,524 INFO  [stdout] (http--127.0.0.1-8080-10) Hibernate Configuration loaded 09:02:20,531 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354) 09:02:20,574 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:275) 09:02:20,544 INFO  [stdout] (http--127.0.0.1-8080-17) Hibernate Configuration loaded 09:02:20,588 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326) 09:02:20,601 INFO  [stdout] (http--127.0.0.1-8080-16) Hibernate Configuration loaded 09:02:20,623 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 09:02:20,631 INFO  [stdout] (http--127.0.0.1-8080-2) Hibernate Configuration loaded 09:02:20,638 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1127) 09:02:20,642 INFO  [stdout] (http--127.0.0.1-8080-12) Hibernate Configuration loaded 09:02:20,644 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:325) 09:02:20,647 INFO  [stdout] (http--127.0.0.1-8080-13) Hibernate Configuration loaded 09:02:20,655 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 09:02:20,684 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 09:02:20,698 ERROR [stderr] (http--127.0.0.1-8080-7)    at es.cecabank.isct.servicios.wsimpl.transferencias.ws_recep_transferencia.WS_recep_transferenciaSkeleton.ejecutarLogica(WS_recep_transferenciaSkeleton.java:159) 09:02:20,707 ERROR [stderr] (http--127.0.0.1-8080-7)    at es.cecabank.isct.servicios.wsimpl.AbstractSkeleton.ejecutar(AbstractSkeleton.java:82) 09:02:20,710 ERROR [stderr] (http--127.0.0.1-8080-7)    at es.cecabank.isct.servicios.wsimpl.AbstractSkeleton.ejecutarOperacionWS(AbstractSkeleton.java:383) 09:02:20,659 INFO  [stdout] (http--127.0.0.1-8080-3) Hibernate Configuration loaded 09:02:20,716 ERROR [stderr] (http--127.0.0.1-8080-7)    at es.cecabank.isct.servicios.wsimpl.transferencias.ws_recep_transferencia.WS_recep_transferenciaSkeleton.recepcionTransferenciaOp(WS_recep_transferenciaSkeleton.java:53) 09:02:20,718 INFO  [stdout] (http--127.0.0.1-8080-11) Hibernate Configuration loaded 09:02:20,721 ERROR [stderr] (http--127.0.0.1-8080-7)    at es.cecabank.isct.logica.logicaimpl.MessageReceiverInOut.generateEnvelope(MessageReceiverInOut.java:203) 09:02:20,723 INFO  [stdout] (http--127.0.0.1-8080-18) Hibernate Configuration loaded 09:02:20,727 ERROR [stderr] (http--127.0.0.1-8080-7)    at es.cecabank.isct.logica.logicaimpl.MessageReceiverInOut.invokeBusinessLogic(MessageReceiverInOut.java:56) 09:02:20,739 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) 09:02:20,743 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) 09:02:20,730 INFO  [stdout] (http--127.0.0.1-8080-15) Hibernate Configuration loaded 09:02:20,750 INFO  [stdout] (http--127.0.0.1-8080-9) Hibernate Configuration loaded 09:02:20,747 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181) 09:02:20,754 INFO  [stdout] (http--127.0.0.1-8080-5) Hibernate Configuration loaded 09:02:20,757 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172) 09:02:20,774 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146) 09:02:20,764 INFO  [stdout] (http--127.0.0.1-8080-4) Hibernate Configuration loaded 09:02:20,788 INFO  [stdout] (http--127.0.0.1-8080-17) Hibernate Configuration loaded 09:02:20,782 ERROR [stderr] (http--127.0.0.1-8080-7)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) 09:02:20,797 INFO  [stdout] (http--127.0.0.1-8080-1) Hibernate Configuration loaded 09:02:20,809 INFO  [stdout] (http--127.0.0.1-8080-19) Hibernate Configuration loaded 09:02:20,816 INFO  [stdout] (http--127.0.0.1-8080-2) Hibernate Configuration loaded 09:02:20,805 ERROR [stderr] (http--127.0.0.1-8080-7)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 09:02:20,828 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) 09:02:20,825 INFO  [stdout] (http--127.0.0.1-8080-8) Hibernate Configuration loaded 09:02:20,845 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) 09:02:20,855 INFO  [stdout] (http--127.0.0.1-8080-16) Hibernate Configuration loaded 09:02:20,886 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) 09:02:20,909 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) 09:02:20,892 INFO  [stdout] (http--127.0.0.1-8080-13) Hibernate Configuration loaded 09:02:20,923 INFO  [stdout] (http--127.0.0.1-8080-12) Hibernate Configuration loaded 09:02:20,919 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) 09:02:20,960 INFO  [stdout] (http--127.0.0.1-8080-11) Hibernate Configuration loaded 09:02:20,991 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) 09:02:20,994 INFO  [stdout] (http--127.0.0.1-8080-22) Hibernate Configuration loaded 09:02:21,004 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) 09:02:21,007 INFO  [stdout] (http--127.0.0.1-8080-20) Hibernate Configuration loaded 09:02:21,010 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 09:02:21,013 INFO  [stdout] (http--127.0.0.1-8080-21) Hibernate Configuration loaded 09:02:21,015 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 09:02:21,017 INFO  [stdout] (http--127.0.0.1-8080-18) Hibernate Configuration loaded 09:02:21,020 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) 09:02:21,022 INFO  [stdout] (http--127.0.0.1-8080-3) Hibernate Configuration loaded 09:02:21,024 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) 09:02:21,028 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.coyote.http11.Http11Protocol$  Http11ConnectionHandler.process(Http11Protocol.java:671) 09:02:21,042 ERROR [stderr] (http--127.0.0.1-8080-7)    at org.apache.tomcat.util.net.JIoEndpoint$  Worker.run(JIoEndpoint.java:930) 09:02:21,045 ERROR [stderr] (http--127.0.0.1-8080-7)    at java.lang.Thread.run(Thread.java:745) 09:02:21,048 INFO  [stdout] (http--127.0.0.1-8080-7) Error al cerrar 09:02:21,048 ERROR [stderr] (http--127.0.0.1-8080-10) org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.event.service.spi.EventListenerRegistry] 09:02:21,053 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:126) 09:02:21,059 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.action.internal.EntityAction.listenerGroup(EntityAction.java:194) 09:02:21,065 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.action.internal.EntityInsertAction.hasPostCommitEventListeners(EntityInsertAction.java:206) 09:02:21,073 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.action.internal.EntityAction.needsAfterTransactionCompletion(EntityAction.java:88) 09:02:21,076 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.action.internal.EntityAction.getAfterTransactionCompletionProcess(EntityAction.java:80) 09:02:21,078 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.engine.spi.ActionQueue.registerCleanupActions(ActionQueue.java:378) 09:02:21,081 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:365) 09:02:21,084 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354) 09:02:21,086 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:275) 09:02:21,089 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326) 09:02:21,092 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) 09:02:21,094 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1127) 09:02:21,104 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:325) 09:02:21,107 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) 09:02:21,110 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) 09:02:21,113 ERROR [stderr] (http--127.0.0.1-8080-10)   at es.cecabank.isct.servicios.wsimpl.transferencias.ws_recep_transferencia.WS_recep_transferenciaSkeleton.ejecutarLogica(WS_recep_transferenciaSkeleton.java:159) 09:02:21,116 ERROR [stderr] (http--127.0.0.1-8080-10)   at es.cecabank.isct.servicios.wsimpl.AbstractSkeleton.ejecutar(AbstractSkeleton.java:82) 09:02:21,119 ERROR [stderr] (http--127.0.0.1-8080-10)   at es.cecabank.isct.servicios.wsimpl.AbstractSkeleton.ejecutarOperacionWS(AbstractSkeleton.java:383) 09:02:21,122 ERROR [stderr] (http--127.0.0.1-8080-10)   at es.cecabank.isct.servicios.wsimpl.transferencias.ws_recep_transferencia.WS_recep_transferenciaSkeleton.recepcionTransferenciaOp(WS_recep_transferenciaSkeleton.java:53) 09:02:21,125 ERROR [stderr] (http--127.0.0.1-8080-10)   at es.cecabank.isct.logica.logicaimpl.MessageReceiverInOut.generateEnvelope(MessageReceiverInOut.java:203) 09:02:21,128 ERROR [stderr] (http--127.0.0.1-8080-10)   at es.cecabank.isct.logica.logicaimpl.MessageReceiverInOut.invokeBusinessLogic(MessageReceiverInOut.java:56) 09:02:21,137 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) 09:02:21,140 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114) 09:02:21,142 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181) 09:02:21,145 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172) 09:02:21,148 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146) 09:02:21,151 ERROR [stderr] (http--127.0.0.1-8080-10)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) 09:02:21,154 ERROR [stderr] (http--127.0.0.1-8080-10)   at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 09:02:21,156 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) 09:02:21,159 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) 09:02:21,162 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) 09:02:21,165 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) 09:02:21,174 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) 09:02:21,182 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) 09:02:21,185 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) 09:02:21,188 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 09:02:21,191 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 09:02:21,194 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) 09:02:21,203 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) 09:02:21,206 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.coyote.http11.Http11Protocol$  Http11ConnectionHandler.process(Http11Protocol.java:671) 09:02:21,209 ERROR [stderr] (http--127.0.0.1-8080-10)   at org.apache.tomcat.util.net.JIoEndpoint$  Worker.run(JIoEndpoint.java:930) 09:02:21,212 ERROR [stderr] (http--127.0.0.1-8080-10)   at java.lang.Thread.run(Thread.java:745) 

differece between hibernate, leave and suspend

I would like to know what the difference between those three concepts are. It seems that the closing menu becomes longer every some time, although in the end most people only uses one or two of the options.

Hibernate, suspend and leave. We all know that leave means leave, but apart of the intended punt, what does it mean in this exit (oops!) or leave menu in Ubuntu, or in my case Lubuntu 18.1?

Will we have remain and extended session any time soon? All this allows for so many jokes in the UK.

Hibernate não Alterar Automaticamente no Banco de Dados

gostaria que e o Hibernate não fizesse alterações diretamente no banco de dados, ou seja, gostaria que ele seguisse o que está no banco de dados. Exemplo : Caso na minha entidade eu tenha a seguinte situação

@ManyToOne @JoinColumn(name="locacao_codcliente", foreignKey=@ForeignKey(name = "LO_CL_FK")) private Cliente cliente;  @ManyToOne @JoinColumn(name="locacao_codvendedor", foreignKey=@ForeignKey(name = "LO_VE_FK")) private Vendedor vendedor; 

Notem que eu teria dois campos que são chave estrangeiras que irão receber os nomes locacao_codvendedor e locacao_codcliente.

Gostaria que caso o DBA não tivesse criado estes campos lá no banco de dados ele não criasse automaticamente. Estou começando agora e prefiro seguir o padrão de que os campos já estejam criados no banco de dados.

A criação do meu banco de dados está conforme abaixo :

spring.datasource.url = jdbc:mysql://localhost:3306/sitiusdb?useTimezone=true&serverTimezone=UTC spring.datasource.username = root spring.datasource.password = root  spring.jpa.show-sql = true  spring.jpa.hibernate.ddl-auto = update  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect 

Аннотация Hibernate @ManyToMany?

Есть такой пример:

@Entity public class Student {     @Id     private long id;          private String name;      @ManyToMany     @JoinTable (name="student_university",        joinColumns=@JoinColumn (name="student_id"),        inverseJoinColumns=@JoinColumn(name="university_id"))     private List<University> universities;      // set/get не представлены }  @Entity public class University {     @Id     private long id;      @Column     private String name;      @ManyToMany     @JoinTable(name="student_university",        joinColumns=@JoinColumn(name="university_id"),         inverseJoinColumns=@JoinColumn(name="student_id"))     private List<Student> students;      // set/get не представлены } 

Вот описание к этому примеру – Параметр joinColumns указывает на поле, которое используется для прямой связи (идентификатор student_id). Параметр inverseJoinColumns указывает на поле, которое используется для обратной связи (идентификатор university_id). Для указания столбцов связи из таблицы используется аннотация @JoinColumn.

Мне непонятно отсюда, что значит “для прямой связи” и “для обратной связи”.Почему параметры подставляются в joinColumns и inverseJoinColumns в таком, как бы обратном порядке?

Two swapfiles, hibernate working, how to correctly configure hibernate to not run out of space, or fail somehow

I have configured hibernate, its working, just to make sure it will not fail sometime – this question.

I have two swap files on different devices, first is small swap on SSD, second as big as ram on HDD. Hibernate configured to small one. It works fine for now, as hibernate not always requires too much(not everything written or compressed, I don’t known).

How to configure hibernate to use both swaps? Or it process them automatically and nothing need to do? At kernel options I have setup for first small swap, and its good if it will use it first(as fastest) and then second.
I don’t want to make SSD swap larger as SSD is small.

leonid@DevSSD:~$   grep resume < /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="no_console_suspend initcall_debug resume=UUID=050f8852-d8f6-4979-a4e4-c3d9b981bee9 resume_offset=34816" 

/etc/fstab

UUID=050f8852-d8f6-4979-a4e4-c3d9b981bee9   /   ext4    relatime,grpquota,data=ordered,usrquota,rw,errors=remount-ro,quota  0   1 UUID=3bcf1591-7033-416a-addf-9cf8e2e10c93   /home/leonid/hdd    ext4    defaults,rw,errors=remount-ro   0   1 /swapfile                   none    swap    sw  0   0 /home/leonid/hdd/swapfile   none    swap    sw  0   0 UUID=26DA-1C76  /boot/efi   vfat    defaults    0   1 

How to Hibernate in Ubuntu 18.04

It seems like Hibernate function is not working properly on Ubuntu 18.04. I have tried with several commands like sudo pm-hibernate, sudo systemctl hibernate etc. Nothing works.

Is hibernate also related to Hardware? My laptop RAM is 16GB and I have created the swap partition with the size of 24GB.

Any suggestion?