title,body,link,tags,view_count,is_answered,score,answer_count
Wrong encoding in java database testing,"<p>I am testing database connection and object-relational mapping, but I run to a problem.</p>
<p>I have the same testing class on two different branches. The problem is that on master branch, the test passes, on the feature one, it fails. I need the test to pass on the feature branch.</p>
<pre><code>@SpringBootTest
 public class CodeTableTest {

@Autowired
private CodeTableService codeTableService;

@Autowired
private CodeTableTranslator codeTableTranslator;

@Test
public void shouldLoadSexCodeTable() {
    assertThat(codeTableService.getCodeTableData(&quot;SEX&quot;)).containsKeys(&quot;1&quot;, &quot;2&quot;);
    assertThat(codeTableTranslator.getDescription(&quot;SEX&quot;, &quot;1&quot;)).isEqualTo(&quot;Muž&quot;);
}

@Test
public void shouldLoadWorkplaceCodeTable() {
    assertThat(codeTableService.getCodeTableData(&quot;WORKPLACE&quot;)).containsOnlyKeys(
            IntStream.range(100, 107)
                    .mapToObj(Integer::toString)
                    .toArray(String[]::new));
    assertThat(codeTableTranslator.getDescription(&quot;WORKPLACE&quot;, &quot;103&quot;)).isEqualTo(&quot;Masarykovo nám.56, Stříbro, 34901&quot;);
    assertThat(codeTableTranslator.getShortDescription(&quot;WORKPLACE&quot;, &quot;103&quot;)).isEqualTo(&quot;Stříbro&quot;);
    }

}
</code></pre>
<p>On master branch, this test passes.
However, on feature branch (which was created by mine colleague from different country), the same test fails, due to encoding reasons:</p>
<pre><code>Expecting:
 &lt;&quot;MuĹľ&quot;&gt;
to be equal to:
 &lt;&quot;Muž&quot;&gt;
but was not.
org.opentest4j.AssertionFailedError: 
Expecting:
 &lt;&quot;MuĹľ&quot;&gt;
to be equal to:
 &lt;&quot;Muž&quot;&gt;
but was not.
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at com.generali.gef.demo.mapper.CodeTableTest.shouldLoadSexCodeTable(CodeTableTest.java:25)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
    at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at com.sun.proxy.$Proxy5.stop(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
    at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.base/java.lang.Thread.run(Thread.java:829)
</code></pre>
<p>The second test also fails for the same reasons:</p>
<pre><code>Expecting:
 &lt;&quot;Masarykovo nĂˇm.56, StĹ™Ă­bro, 34901&quot;&gt;
to be equal to:
 &lt;&quot;Masarykovo nám.56, Stříbro, 34901&quot;&gt;
but was not.
org.opentest4j.AssertionFailedError: 
Expecting:
 &lt;&quot;Masarykovo nĂˇm.56, StĹ™Ă­bro, 34901&quot;&gt;
to be equal to:
 &lt;&quot;Masarykovo nám.56, Stříbro, 34901&quot;&gt;
but was not.
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at com.generali.gef.demo.mapper.CodeTableTest.shouldLoadWorkplaceCodeTable(CodeTableTest.java:33)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
    at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at com.sun.proxy.$Proxy5.stop(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
    at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.base/java.lang.Thread.run(Thread.java:829)
</code></pre>
<p>Now, how do you solve such an issue? I have tried copying and pasting all gradle files, as well as checking for differences in SQL schema and data types, but without success.</p>
<p>Thanks</p>
<p><strong>edit:</strong></p>
<p>The project is for tutorial purposes, The data is filled automatically into the database. The data is inserted correcty, (checked with console and SELECT statement), hovewer, the issue seems to be produced when I try to load the data from the database.</p>
<p><strong>Mine SQL scripts on both branches:</strong></p>
<p>schema.sql</p>
<pre><code>create table policy
(
   id integer not null,
   policy_id integer not null,
   product varchar(255) not null,
   status varchar(255) not null,
   valid_from date,
   valid_to date,
   signed_at NUMBER(10),
   dummy_policy boolean,
   json clob,
   primary key(id)
);

CREATE TABLE ADT_DOMAINS
(
  DOMAIN VARCHAR2(100 BYTE) NOT NULL
, KEY_VALUE VARCHAR2(30 BYTE) NOT NULL
, TEXT VARCHAR2(240 BYTE) NOT NULL
, SHORT_TEXT VARCHAR2(100 BYTE)
, LANG NUMBER(2, 0) DEFAULT 3 NOT NULL
, ORDER_BY NUMBER(10, 0) NOT NULL
, VALID_FROM DATE
, VALID_TILL DATE
, DATE_CREATED TIMESTAMP(6) DEFAULT systimestamp
, USER_CREATED NUMBER(10, 0)
, DATE_MODIFIED TIMESTAMP(6)
, USER_MODIFIED NUMBER(10, 0)
, COMPANY_ID NUMBER(3, 0) NOT NULL
);

CREATE TABLE WORKPLACE
(
  WORKPLACE_ID NUMBER(10) NOT NULL,
  CITY VARCHAR2(150 BYTE),
  STREET VARCHAR2(150 BYTE),
  ZIP_CODE VARCHAR2(10 BYTE),
  AGENCY_ID NUMBER(3)
);
</code></pre>
<p>data.sql</p>
<pre><code>insert into policy
values(10001, 603586, 'PMV', 'D', '2019-06-27', '2020-06-27', 101, false, '{
   &quot;name&quot;:&quot;Brandon Goodin&quot;,
   &quot;birthDate&quot;:&quot;1992-06-27&quot;
}');

insert into policy
values(10002, 603587, 'MAJ', 'DX', '2013-05-14', '2018-06-27', 104, true, '{
  &quot;name&quot;:&quot;Christian Poitras&quot;,
   &quot;birthDate&quot;:&quot;1985-03-18&quot;
}');

Insert into ADT_DOMAINS (DOMAIN,KEY_VALUE,TEXT,SHORT_TEXT,LANG,ORDER_BY,VALID_FROM,VALID_TILL,DATE_CREATED,USER_CREATED,DATE_MODIFIED,USER_MODIFIED,COMPANY_ID)
values ('SEX','1','Muž','Muž','3','1',to_date('01.01.04','DD.MM.RR'),null,to_timestamp('25.01.05 14:33:05,035149000','DD.MM.RR HH24:MI:SSXFF'),null,null,null,'1');

Insert into ADT_DOMAINS (DOMAIN,KEY_VALUE,TEXT,SHORT_TEXT,LANG,ORDER_BY,VALID_FROM,VALID_TILL,DATE_CREATED,USER_CREATED,DATE_MODIFIED,USER_MODIFIED,COMPANY_ID)
values ('SEX','2','Žena','Žena','3','2',to_date('01.01.04','DD.MM.RR'),null,to_timestamp('25.01.05 14:33:05,054860000','DD.MM.RR HH24:MI:SSXFF'),null,null,null,'1');


insert into WORKPLACE (WORKPLACE_ID, CITY, STREET, ZIP_CODE, AGENCY_ID)
values (100,    'Brno', 'Hlavní 15/140',    '62400',    633);

insert into WORKPLACE (WORKPLACE_ID, CITY, STREET, ZIP_CODE, AGENCY_ID)
values (101,    'Poděbrady', 'Fugnerova 28',    '29001',    138);

insert into WORKPLACE (WORKPLACE_ID, CITY, STREET, ZIP_CODE, AGENCY_ID)
values (102,    'Louny', '17.listopadu 2071',   '44001',    437);

insert into WORKPLACE (WORKPLACE_ID, CITY, STREET, ZIP_CODE, AGENCY_ID)
values (103,    'Stříbro', 'Masarykovo nám.56', '34901',    340);

insert into WORKPLACE (WORKPLACE_ID, CITY, STREET, ZIP_CODE, AGENCY_ID)
values (104,    'Poděbrady', 'Fugnerova 28',    '29001',    138);

insert into WORKPLACE (WORKPLACE_ID, CITY, STREET, ZIP_CODE, AGENCY_ID)
values (105,    'Šumperk', 'Generála Svobody 45/16',    '78969',    739);

insert into WORKPLACE (WORKPLACE_ID, CITY, STREET, ZIP_CODE, AGENCY_ID)
values (106,    'Praha 5', 'Stroupežnického 30',    '15000',    140);
</code></pre>
",https://stackoverflow.com/questions/70095183/wrong-encoding-in-java-database-testing,"['java', 'sql']",128,True,0,1
Android ROOM database testing uninstall within Androiid Studio - how to survive reinstall of app,"<p>I am developing an app that uses the ROOM database implemetation. The database is simple with only 2 tables.</p>
<p>I am trying to simulate what will happen with the persisted data when the app is uninstalled and reinstalled, hoping that it will be included in the default google app backup.</p>
<p>This is where I am confused - Within Android Studio I start a debugging session that re installs the App after Uninstall - I can add data to database running the app in a debug session or normally from the device. The database survives a restart etc of the phone and updated data remains.</p>
<p>BUT when I uninstall and reinstall using a debugging session I have a version of the  database come across somehow from android studio - one from earlier debugging - All of the changes since last reinstall are lost.</p>
<p>Where is this database copy coming from and more importantly how can I make sure that my db changes survive an app uninstall and reinstall.</p>
<p>I am using the path returned by getdatabasepath()</p>
<p>Any help or pointers appreciated on approaches to ensure this dataset survives app reinstall.</p>
<p>I am building the DB as follows</p>
<pre><code>return Room.databaseBuilder(context,
       MyDb.class,
       Constants.DB_NAME).allowMainThreadQueries().build();
</code></pre>
<p>And getting an instance of the DB like so</p>
<pre><code>MyDB = DigiDocketDB.getInstance(MainActivity.this);
</code></pre>
<p>Cheers,
Courtney.</p>
",https://stackoverflow.com/questions/68979029/android-room-database-testing-uninstall-within-androiid-studio-how-to-survive,"['android', 'android-room']",166,False,0,0
How to set parameters for laravel 8 factory?,"<p>In my Laravel 8  reading how factory works at <a href=""https://laravel.com/docs/8.x/database-testing"" rel=""nofollow noreferrer"">https://laravel.com/docs/8.x/database-testing</a>
when I set params in factory call :</p>
<pre><code>$ads = Ad::factory()-&gt;count(10)-&gt;create([
    'year'=&gt; $year, 'month'=&gt; $month
]);
</code></pre>
<p>I did not find how can I read this name param value in my factory database/factories/AdFactory.php :</p>
<pre><code>&lt;?php

namespace Database\Factories;

use Config;
use Carbon\Carbon;
use App\Models\Ad;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use \Cviebrock\EloquentSluggable\Services\SlugService;

class AdFactory extends Factory
{
    protected $model = Ad::class;

    public function definition()
    {
        $text= $this-&gt;faker-&gt;text;
        $slugValue = SlugService::createSlug(Ad::class, 'slug', $text);


        $startDate = new Carbon('first day of this month');
        return [
            'title' =&gt; $text,
            'ad_token' =&gt; $text,
            'slug' =&gt; $slugValue,
            'phone_display' =&gt; (rand(1, 3) == 1),
            'has_locations' =&gt; (rand(1, 4) == 1),
            'status' =&gt; 'A', // password
            'price' =&gt; mt_rand(10, 500),
            'ad_type' =&gt; (rand(1, 2) == 1 ? 'B' : 'S'),
            'expire_date' =&gt; $this-&gt;faker-&gt;dateTimeInInterval($startDate, '1 month', Config::get('app.timezone'))-&gt;format('Y-m-d H:i:s'),
            'description' =&gt; $this-&gt;faker-&gt;paragraphs(rand(1, 4), true),
            'creator_id' =&gt; rand(1, 5),
        ];
    }
}
</code></pre>
<p>In this case year and month are not fields for Ad model, but I need them to set value
for expire_date withing given month.</p>
<p>Which way is valid ?</p>
<p><strong>MODIFIED BLOCK :</strong>
Reading <a href=""https://laravel.com/docs/8.x/database-testing#factory-states"" rel=""nofollow noreferrer"">https://laravel.com/docs/8.x/database-testing#factory-states</a>
I remade factory and I did not find how to get my additive parameters :</p>
<pre><code>&lt;?php

namespace Database\Factories;

use Config;
use Carbon\Carbon;
use App\Models\Ad;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
//use Cviebrock\EloquentSluggable\Sluggable;
use \Cviebrock\EloquentSluggable\Services\SlugService;

class AdFactory extends Factory
{
    protected $model = Ad::class;

    public function definition()
    {
        $text= $this-&gt;faker-&gt;text;
        $slugValue = SlugService::createSlug(Ad::class, 'slug', $text);

        \Log::info(  varDump($this, ' -1 $attributes::') );
        $startDate = new Carbon('first day of this month');
        return [
            'title' =&gt; $text,
            'ad_token' =&gt; $text,
            'slug' =&gt; $slugValue,
            'phone_display' =&gt; (rand(1, 3) == 1),
            'has_locations' =&gt; (rand(1, 4) == 1),
            'status' =&gt; 'A', // password
            'price' =&gt; mt_rand(10, 500),
            'ad_type' =&gt; (rand(1, 2) == 1 ? 'B' : 'S'),
            'expire_date' =&gt; $this-&gt;faker-&gt;dateTimeInInterval($startDate, '1 month', Config::get('app.timezone'))-&gt;format('Y-m-d H:i:s'),
//            'description' =&gt; $this-&gt;faker-&gt;paragraphs(rand(1, 4), true),
            'creator_id' =&gt; rand(1, 5),
        ];
    }

    public function expired()
    {
        return $this-&gt;state(function (array $attributes, $var1=null, $var2=null) {

            // $var1and $var 2 are null and $attributes has no year/month parameters 
            \Log::info(  varDump($var1, ' -1 expired $var1::') );
            \Log::info(  varDump($var2, ' -1 expired $var2::') );
            \Log::info(  varDump($attributes, ' -1 expired $attributes::') );
            return [ // This changes applied. Just example
                'description' =&gt; 'suspended expired',
            ];
        });
    }
}
</code></pre>
<p>and I pass parameters in factory calling:</p>
<pre><code>$ads = Ad::factory()-&gt;count(10)-&gt;expired($year, $month)-&gt;create([
</code></pre>
<p>?</p>
<p>Thanks!</p>
",https://stackoverflow.com/questions/65770708/how-to-set-parameters-for-laravel-8-factory,"['laravel', 'laravel-factory']",1196,False,0,0
AJAX Call to Controller from Partial View,"<p>I have a Login page which is a partial view, and want to display database connection status when page is shown.</p>
<p>My idea is calling a database testing function in controller through AJAX, which returns the status string. But the controller function is not being fired, and the &quot;success&quot; function just get a HTML as response.</p>
<p>After hours of research but no success.</p>
<p>Could you please help. Thanks!</p>
<p>The controller returns login page:</p>
<pre><code>public ActionResult Login()
{
    return PartialView();
}
</code></pre>
<p>The AJAX call in Login page:</p>
<pre><code>$(document).ready(function () {
    setTimeout(testConn, 100);
});

function testConn() {
    $('#msg').text('Connecting database...');
    $.ajax({
        type: 'GET',
        url: '@Url.Action(&quot;TestDbConn&quot;, &quot;Utils&quot;)',
        contentType: 'application/json; charset=utf-8',
        success: function (s) {
            $('#msg').text(s); // s is HTML, not a string what I want
        }
    });
}
</code></pre>
<p>The TestDbConn function in <code>UtilsController</code>:</p>
<pre><code>public JsonResult TestDbConn()
{
    string result = &quot;&quot;;

    try
    {
        var user = db.UserGroup.FirstOrDefault();

        if (user == null)
        {
            result = &quot;No available data!&quot;;
        }
        else
        {
            result = &quot;Database connected!&quot;;
        }
    }
    catch (Exception ex)
    {
        result = $&quot;Unable to connect：{ex.Message}&quot;;
    }

    return Json(result, JsonRequestBehavior.AllowGet);
}
</code></pre>
",https://stackoverflow.com/questions/69849644/ajax-call-to-controller-from-partial-view,"['asp.net', 'ajax', 'asp.net-mvc']",76,True,0,1
Connection timeout using local kafka-connect cluster to connect on a remote database,"<p>I'm trying to run a local kafka-connect cluster using docker-compose.
I need to connect on a remote database and i'm also using a remote kafka and schema-registry.
I have enabled access to these remotes resources from my machine.</p>
<p>To start the cluster, on my project folder in my Ubuntu WSL2 terminal, i'm running</p>
<p><code>docker build -t my-connect:1.0.0</code></p>
<p><code>docker-compose up</code></p>
<p>The application runs successfully, but when I try to create a new connector, returns error 500 with timeout.</p>
<p><strong>My Dockerfile</strong></p>
<pre><code>FROM confluentinc/cp-kafka-connect-base:5.5.0

RUN cat /etc/confluent/docker/log4j.properties.template

ENV CONNECT_PLUGIN_PATH=&quot;/usr/share/java,/usr/share/confluent-hub-components&quot;
ARG JDBC_DRIVER_DIR=/usr/share/java/kafka/

RUN   confluent-hub install --no-prompt confluentinc/kafka-connect-jdbc:5.5.0 \
   &amp;&amp; confluent-hub install --no-prompt confluentinc/connect-transforms:1.3.2

ADD java/kafka-connect-jdbc /usr/share/confluent-hub-components/confluentinc-kafka-connect-jdbc/lib/
COPY java/kafka-connect-jdbc/ojdbc8.jar /usr/share/confluent-hub-components/confluentinc-kafka-connect-jdbc/lib/

ENTRYPOINT [&quot;sh&quot;,&quot;-c&quot;,&quot;export CONNECT_REST_ADVERTISED_HOST_NAME=$(hostname -I);/etc/confluent/docker/run&quot;] 
</code></pre>
<p><strong>My docker-compose.yaml</strong></p>
<pre><code>services:
  connect:
    image: my-connect:1.0.0
    ports:
     - 8083:8083
    environment:
      - CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL=http=//schema-registry:8081
      - CONNECT_KEY_CONVERTER=io.confluent.connect.avro.AvroConverter
      - CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL=http=//schema-registry:8081
      - CONNECT_BOOTSTRAP_SERVERS=broker1.intranet:9092
      - CONNECT_GROUP_ID=kafka-connect
      - CONNECT_INTERNAL_KEY_CONVERTER=org.apache.kafka.connect.json.JsonConverter
      - CONNECT_VALUE_CONVERTER=io.confluent.connect.avro.AvroConverter
      - CONNECT_INTERNAL_VALUE_CONVERTER=org.apache.kafka.connect.json.JsonConverter
      - CONNECT_OFFSET_STORAGE_TOPIC=kafka-connect.offset
      - CONNECT_CONFIG_STORAGE_TOPIC=kafka-connect.config
      - CONNECT_STATUS_STORAGE_TOPIC=kafka-connect.status
      - CONNECT_CONNECTOR_CLIENT_CONFIG_OVERRIDE_POLICY=All
      - CONNECT_LOG4J_ROOT_LOGLEVEL=INFO
      - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
      - CONNECT_REST_ADVERTISED_HOST_NAME=localhost
</code></pre>
<p><strong>My cluster it's up</strong></p>
<pre><code>~$ curl -X GET http://localhost:8083/
{&quot;version&quot;:&quot;5.5.0-ccs&quot;,&quot;commit&quot;:&quot;606822a624024828&quot;,&quot;kafka_cluster_id&quot;:&quot;OcXKHO7eT4m9NBHln6ACKg&quot;}
</code></pre>
<p>Connector call</p>
<pre><code>curl -i -X POST -H &quot;Accept:application/json&quot; -H &quot;Content-Type:application/json&quot; localhost:8083/connectors/ -d
{
    &quot;name&quot;: &quot;my-connector&quot;,
    &quot;config&quot;:  
    { 
    &quot;connector.class&quot; : &quot;io.debezium.connector.oracle.OracleConnector&quot;,
    &quot;tasks.max&quot;: &quot;1&quot;,
    &quot;database.user&quot;: &quot;user&quot;, 
    &quot;database.password&quot;: &quot;pass&quot;,    
    &quot;database.dbname&quot;:&quot;SID&quot;,
    &quot;database.schema&quot;:&quot;schema&quot;,
    &quot;database.server.name&quot;: &quot;dbname&quot;,   
    &quot;schema.include.list&quot;: &quot;schema&quot;,    
    &quot;database.connection.adapter&quot;:&quot;logminer&quot;,   
    &quot;database.hostname&quot;:&quot;databasehost&quot;,
    &quot;database.port&quot;:&quot;1521&quot;
   }
}
</code></pre>
<p><strong>Error</strong></p>
<pre><code>{&quot;error_code&quot;: 500,&quot;message&quot;: &quot;IO Error trying to forward REST request: java.net.SocketTimeoutException: Connect Timeout&quot;}

## LOG
connect_1  | [2021-07-01 19:08:50,481] INFO Database Version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
connect_1  | Version 19.4.0.0.0 (io.debezium.connector.oracle.OracleConnection)
connect_1  | [2021-07-01 19:08:50,628] INFO Connection gracefully closed (io.debezium.jdbc.JdbcConnection)
connect_1  | [2021-07-01 19:08:50,643] INFO AbstractConfig values:
connect_1  |  (org.apache.kafka.common.config.AbstractConfig)
connect_1  | [2021-07-01 19:09:05,722] ERROR IO error forwarding REST request:  (org.apache.kafka.connect.runtime.rest.RestClient)
connect_1  | java.util.concurrent.ExecutionException: java.net.SocketTimeoutException: Connect Timeout
</code></pre>
<p><strong>Testing the connection to the database</strong></p>
<p><code>$ telnet databasehostname 1521</code>
<code>Trying &lt;ip&gt;... Connected to databasehostname</code></p>
<p><strong>Testing connection to kafka broker</strong></p>
<p><code>$ telnet broker1.intranet 9092</code>
<code>Trying &lt;ip&gt;... Connected to broker1.intranet</code></p>
<p><strong>Testing connection to remote schema-registry</strong></p>
<p><code>$ telnet schema-registry.intranet 8081</code>
<code>Trying &lt;ip&gt;... Connected to schema-registry.intranet</code></p>
<p>What am I doing wrong? Do I need to configure something else to allow connection to this remote database?</p>
",https://stackoverflow.com/questions/68217193/connection-timeout-using-local-kafka-connect-cluster-to-connect-on-a-remote-data,"['docker', 'docker-compose', 'apache-kafka-connect', 'debezium']",2384,True,5,1
Azure: An attempt was made to access a socket in a way forbidden by its access permissions 10.0.0.4:3306,"<p>I created a mysql database instance in North Europe, then a Web app there in
North Europe, via VS published in Azure and at startup I get an <a href=""https://i.stack.imgur.com/H85dw.png"" rel=""nofollow noreferrer"">exception</a> as in the screenshot. Everything works locally in VS using this connection string, but not in Azure itself. If you disable the DB instance, the exception is the same, so the application does not connect to the DB at all. I have been suffering with this problem for 4 hours. The connection port to MySQL Azure does not change. <a href=""https://i.stack.imgur.com/thgdZ.png"" rel=""nofollow noreferrer"">In the security settings in my opinion everything is fine.</a> The local mysql server that could theoretically occupy port 3306 is <a href=""https://i.stack.imgur.com/Fwk06.png"" rel=""nofollow noreferrer"">disabled.</a></p>
<p>connectionString=&quot;Server=testing-db-srv2.mysql.database.azure.com; Port=3306; Database=testing-sys-azure; Uid= ###@testing-db-srv2; Pwd= ###; SslMode=Preferred;&quot;</p>
",https://stackoverflow.com/questions/67052408/azure-an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-p,"['sockets', 'exception', 'azure-web-app-service', 'port', 'azure-mysql-database']",355,False,0,1
Deadlock detected when execute doctrine migration (aurora postgres),"<h1>Context</h1>
<h2>Environment</h2>
<p>Back-end: symfony 4.4</p>
<p>Database: PostreSql 10.XX</p>
<h3>Production server</h3>
<ul>
<li>AWS EC2 instance, on Debian, who contain Back-end</li>
<li>AWS Amazon-Aurora instance who contain Database</li>
</ul>
<h3>Testing server</h3>
<p>EC2 instance, on Debian, who contain Back-end and Database</p>
<h3>Development environment</h3>
<p>Ubuntu, who contain Back-end and Database</p>
<h2>What i try to do</h2>
<p>A very simple migration for add Gedmo\SotfDelete in many entities</p>
<pre class=""lang-php prettyprint-override""><code>final class Version20211221101121 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add soft delete';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this-&gt;addSql('ALTER TABLE xxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this-&gt;addSql('ALTER TABLE xxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this-&gt;addSql('ALTER TABLE xxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this-&gt;addSql('ALTER TABLE xxxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this-&gt;addSql('ALTER TABLE xxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this-&gt;addSql('ALTER TABLE xxxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this-&gt;addSql('ALTER TABLE xxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
        $this-&gt;addSql('ALTER TABLE xxxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
        $this-&gt;addSql('ALTER TABLE xxxxxxxxx DROP deleted_at');
    }
}
</code></pre>
<h2>Before I try to do it</h2>
<ul>
<li>I have successfully tried to execute the migration on development environment</li>
<li>I have successfully tried to execute the migration on the testing server</li>
</ul>
<h1>Problem</h1>
<p>When i try to execute the migration on production it throw an SQL error</p>
<p><em><strong>SQL error trace :</strong></em></p>
<pre><code>  SQLSTATE[40P01]: Deadlock detected: 7 ERROR:  deadlock detected                                                      
  DETAIL:  Process 19401 waits for AccessExclusiveLock on relation 25783 of database 25651; blocked by process 20050.  
  Process 20050 waits for AccessShareLock on relation 25768 of database 25651; blocked by process 19401.               
  HINT:  See server log for query details.
</code></pre>
<p><em><strong>Doctrine error trace :</strong></em></p>
<pre><code>  An exception occurred while executing 'ALTER TABLE xxxxxxxxx ADD deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT  
   NULL':                                                                                                                    
                                                                                                                             
  SQLSTATE[40P01]: Deadlock detected: 7 ERROR:  deadlock detected                                                            
  DETAIL:  Process 19401 waits for AccessExclusiveLock on relation 25783 of database 25651; blocked by process 20050.        
  Process 20050 waits for AccessShareLock on relation 25768 of database 25651; blocked by process 19401.                     
  HINT:  See server log for query details. 
</code></pre>
<p>I have temporarily undo the commit while waiting to find the cause and the solution of this problem.</p>
<p>Do you have any idea to solve this problem?</p>
",https://stackoverflow.com/questions/70437219/deadlock-detected-when-execute-doctrine-migration-aurora-postgres,"['postgresql', 'symfony', 'doctrine', 'amazon-aurora']",314,False,1,1
"Why do my tests pass when run together, but fail individually?","<p>Not to be confused with a previously asked question &quot;Why do my tests fail when run together, but pass individually?&quot;</p>
<p>I have a task where I need to modify Junit test classes to handle multiple database testing. Before I can implement that, I need to make sure all tests are running without failures. A thing that mystifies me is that now when I run all classes together it shows it ran with no failures. When I ran one class in specific it suddenly had a failure, result persists if I repeat it.</p>
<p>What might be causing this?</p>
<p>I did not write the tests myself, therefore my knowledge of what is in them is limited. I did modify like 3 of them though.</p>
<p>Pasting the failing test in case it helps</p>
<pre><code>@Test
public void testGetBetonFillerPrM3Str() {
    Composition c = new Composition();
    MixoSettings settings = new MixoSettings();
    settings.setWcwpDecNum(2);

    assertThat(c.getBetonFillerPrM3Str(), is(&quot;&quot;));

    c.setSettings(settings);
    c.setBetonFillerKg(200d);
    c.setTotalVolume(200d);
    assertThat(c.getBetonFillerPrM3Str(), is(&quot;1&quot;));

    setUSLocale();
    assertThat(c.getBetonFillerPrM3Str(), is(&quot;2&quot;));
    setDKLocale();

    c.setBetonFillerKg(200d);
    c.setTotalVolume(0d);
    assertThat(c.getBetonFillerPrM3Str(), is(&quot;&quot;));

    c = new Composition();
    assertThat(c.getBetonFillerPrM3Str(), is(&quot;&quot;));
}
</code></pre>
<p>I am using Eclipse, java 7, JUnit 4</p>
",https://stackoverflow.com/questions/67773358/why-do-my-tests-pass-when-run-together-but-fail-individually,"['java', 'junit4']",673,False,0,1
How do I avoid ClientAccess error on Heroku Postgres?,"<p>Tech stack: node/js, knex, pg</p>
<p>Issue:  On my local machine, my api works fine.  Migrated to Heroku, using a Heroku Postgres database.</p>
<p>Testing so far:</p>
<ul>
<li>Adding an endpoint that returns JSON without touching the database works without error.</li>
<li>Attempting to reset in knex, there is a file pg_hba.conf that is missing an entry.  Although this looks like a candidate for causing this error, I see no current way to view it, let alone edit it.</li>
<li>Deleting and re-creating the database changes the credentials but not the error.</li>
</ul>
<p>Postman Request: GET <a href=""http://node-express-postgres-neometau.herokuapp.com/api/ipsource"" rel=""nofollow noreferrer"">http://node-express-postgres-neometau.herokuapp.com/api/ipsource</a>
(both HTTP and HTTPS return the same error)</p>
<p><strong>code executing:</strong></p>
<pre><code> router.get(&quot;/&quot;, (req, res) =&gt; {
   ipsource.getAllIPSource()
     .then(data =&gt; {
         res.status(201).json(data);
       }).catch((err) =&gt; {
           res.status(500).json({
              message: &quot;Undefined error on server.&quot;,
               error: err
           })
       })
})
</code></pre>
<p><strong>error returned:</strong></p>
<pre><code>&quot;error&quot;: {
        &quot;length&quot;: 168,
        &quot;name&quot;: &quot;error&quot;,
        &quot;severity&quot;: &quot;FATAL&quot;,
        &quot;code&quot;: &quot;28000&quot;,
        &quot;file&quot;: &quot;auth.c&quot;,
        &quot;line&quot;: &quot;496&quot;,
        &quot;routine&quot;: &quot;ClientAuthentication&quot;
    }
</code></pre>
<p>I have not changed anything from default settings; the tutorial I'm following (April 2020) didn't need to change anything.</p>
<p>There was an earlier error where the table was not defined, created the table via Heroku CLI and inserted a trial row.</p>
<p>What settings do I need to change where?</p>
",https://stackoverflow.com/questions/68216846/how-do-i-avoid-clientaccess-error-on-heroku-postgres,"['node.js', 'postgresql', 'heroku']",63,True,0,1
MS-SQL: How to generate fragment of the script to create view only on certain machine?,"<p><strong>Context:</strong> Production environment defines views to access data from another database. Testing environment needs to simulate that by views with the same name and different definition. Instalation script is generated as one text file. I am using MS-SQL Server 2016. The views were defined by someone else.</p>
<p><strong>Details:</strong> The <code>CREATE VIEW dbo.view_xyz ...</code> syntax <em>must be the oly statement in the batch</em>, and--to re-create the view--I need to drop the older version of the view first. Because of that, my installers usually define it like this (if the views are defined by myself):</p>
<pre class=""lang-sql prettyprint-override""><code>IF (OBJECT_ID(N'dbo.view_xyz', 'V') IS NOT NULL)
    DROP VIEW dbo.view_xyz
GO

CREATE VIEW dbo.view_xyz  AS
    SELECT ... [snip usual definition]
</code></pre>
<p>Here, after the <code>GO</code>, the requirement is fulfilled.</p>
<p>I want to use <em>the same installation script</em> at both production and testing machine. So, I want to create the view conditionally (that is <em>do nothing at the production machine</em> and <em>drop and create again</em> on testing machine). I can test the SQL instance to recognize the situation. I would like to do something like:</p>
<pre class=""lang-sql prettyprint-override""><code>IF @@servername = 'TESTMACHINE\SQL2016NAMEDINSTANCE'
    IF OBJECT_ID(N'dbo.view_xyz', 'V') IS NOT NULL
        DROP VIEW dbo.view_xyz

-- the GO cannot be here

    CREATE VIEW dbo.view_xyz  AS
        SELECT * FROM theTableThatSimulatesTheContentOfTheProductionView
END
</code></pre>
<p>However, I cannot place the <code>GO</code> separator in front of the <code>CREATE VIEW ...</code>. The <code>CREATE VIEW ...</code> must not be in the <code>IF ...</code> body.</p>
<p>How to solve that?</p>
",https://stackoverflow.com/questions/66100534/ms-sql-how-to-generate-fragment-of-the-script-to-create-view-only-on-certain-ma,"['sql', 'sql-server', 'syntax', 'scripting']",26,False,0,0
"Azure Data Factory Copy Activity - Does not fail, despite being unsuccessful","<h3>Overview</h3>
<p>I have a Data Factory copy activity in a pipeline that moves tabular data (.csv) from a file in Azure Data Lake into a SQL database-landing schema.</p>
<p>The table definitions will be refreshed each load, in principle, and so there should not be errors. However, I want to log errors in the case that the table exists and the file cannot be mapped to the destination.</p>
<p>I anticipate the activity failing when it cannot match the column to the destination table definition. Strangely my process succeeds despite not loading the file into the database.</p>
<h3>Testing</h3>
<ol>
<li>I added a column in my source file.</li>
<li>I did not update the destination database table definition.</li>
<li>I truncated the destination table.</li>
<li>I unset fault tolerance.</li>
<li>Deleted all copy activity logs (nascent development environment, so this is OK).</li>
<li>Run the pipeline.</li>
<li>Check Data Factory pipeline Output, 100% success rating!?</li>
<li>Query destination table (empty).</li>
<li>Open each log file and look for relevant information (nothing just headers per copy activity call).</li>
</ol>
<h3>Copy activity settings</h3>
<p><a href=""https://i.stack.imgur.com/33by0.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/33by0.png"" alt=""enter image description here"" /></a></p>
",https://stackoverflow.com/questions/67488598/azure-data-factory-copy-activity-does-not-fail-despite-being-unsuccessful,"['azure-sql-database', 'azure-data-factory', 'azure-data-lake-gen2']",580,False,0,0
